Weird problem for BS_OWNERDRAW BN_CLICKED
Hi,
I need to create custom bitmap checkbox. First I create a new class derived
from CButton
-------------------------------------------------------------------------------------------
class CBitmapCheckBox : public CButton
{
DECLARE_DYNAMIC(CBitmapCheckBox)
public:
CBitmapCheckBox();
virtual ~CBitmapCheckBox();
virtual void DrawItem(LPDRAWITEMSTRUCT /*lpDrawItemStruct*/);
VOID SetBitmaps(UINT nIDBitmapChecked, UINT nIDBitmapUnchecked, BOOL
bUpdateDisplay = TRUE);
protected :
DECLARE_MESSAGE_MAP()
};
-------------------------------------------------------------------------------------------
I also add a BUTTON control on my Dialog and set it style to BS_OWNERDRAW.
On my Dialog, I create a control var member for that control and I also
intercept the BN_CLIKED event :
CBitmapCheckBox m_BitmapCheckBox; // MyDlg.h
...
ON_BN_CLICKED(IDC_BUTTON1, &CMyDlg::OnBnClickedButton1)
...
DDX_Control(pDX, IDC_BUTTON1, m_BitmapCheckBox);
Here is the MAJOR problem. When I double click on the control, the function
"OnBnClickedButton1" is call only once ! Why it is not called TWICE ?
However if I use the normal class "CButton" for "m_BitmapCheckBox" and I
double click again on the control, the function "OnBnClickedButton1" is call
TWICE :)
Is someone can explain me ?
Regards,