|
Thanks for the prompt reply.Appreciate it.
I use picture control to display the bitmap.
But then ,the problem I am facing now, is that, there is no OnClick event that I can add.
So what do I do?
Ema
|
|
|
|
|
Did you see CBitmapButton?
|
|
|
|
|
No I don't see the CBitmapButton.How to?
Do i need to add this class?
Ema
|
|
|
|
|
|
I found a simple way to display the bitmap buttons on my main dialog form.
But now I want to display the same bitmap buttons on the other dialog forms
in the same project, but it isn't appearing at all .
Ema
|
|
|
|
|
Did you try with this event WM_ERASEBKGND?
|
|
|
|
|
No,I didn't.Must I add this function?How can it help?
Ema
|
|
|
|
|
See here[^] if you have any question you can ask.
|
|
|
|
|
The method in that article is used if there is a smaller dialog window overlapping on the main dialog window.
Am I right?
But,
My aim is to close the main dialog window.Then appears the next dialog window
which is supposed to display the new bitmap buttons.
Have I missed something important that these owner drawn bitmap buttons are not visible?
Below is my test code snippet:
BOOL CResultsModuleDlg::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
BOOL bReturn = CDialog::Create(IDD, pParentWnd);
if (bReturn)
{
m_bmOrangeButton[1].AutoLoad(IDC_BITMAPBUTTON_ORANGE1, this);
}
return bReturn;
}
Ema
|
|
|
|
|
Do you want to play image on the Button or On the Dialog?
|
|
|
|
|
|
Why you dont use of CBitmapButton?
|
|
|
|
|
I did but the bitmap buttons don't appear either.
I m puzzled.
Ema
|
|
|
|
|
|
I created the owner drawn bitmap buttons on my main dialog form. It appears just fine.
But when I use exactly the same method for my other dialog forms in the same project,
the bitmap buttons are not appearing.Strange.I am puzzled.I've no idea what I have missed out
that i should have included.
Ema
|
|
|
|
|
Did you set owner draw for other buttons?
|
|
|
|
|
Yes,I did set the owner draw attribute.
Ema
|
|
|
|
|
|
Here it goes:
>>>In *.h file:
protected:
CBitmapButton m_bmresultsButton;
// Generated message map functions
//{{AFX_MSG(CResultsDialog)
virtual BOOL OnInitDialog();
>>>In *.cpp file :
BOOL CResultsDialog::OnInitDialog()
{
CDialog::OnInitDialog();
m_bmresultsButton. AutoLoad(IDC_BUTTON_BITMAP105, this);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
>>>In Resource.h file:
#define IDC_BUTTON_BITMAP105 11181
Ema
|
|
|
|
|
Ok Ema check this code:
#include AtlImage.h
CImage m_Image;
m_Button.Create(_T(""),WS_CHILD|WS_VISIBLE,CRect(0,0,100,23),this,idc_button);
m_Image.Load(_T("c:\\1.jpg"));
m_Button.ModifyStyle(0,BS_BITMAP);
m_Button.SetBitmap(m_Image.Detach());
|
|
|
|
|
When I try to include the ATL's supporting header files, I get too many errors.
Because my project previously doesn't cater for ATL.
Ema
|
|
|
|
|
Not problem you can test this code with LoadImage,but you need to use of bmp files with LoadImage and told me whats happenning when run this code?
|
|
|
|
|
|
hhmmm....just as an additional info...how to display the histogram of the image using the visual C++ (MFC)?
|
|
|
|
|
hi all! i have a problem. i have a number of 31 digits and i want to divide it to a number of 2 digits
|
|
|
|