CButton click
-
I have a CButton derived class. I would like this class to handle the click event itself. What should I put in my message map for the button class? ON_BN_CLICKED doesn't work. :confused:
ON_BN_CLICKED just wraps a WM_COMMAND message. You probably want to catch WM_LBUTTONUP messages.
Best wishes, Hans
-
I have a CButton derived class. I would like this class to handle the click event itself. What should I put in my message map for the button class? ON_BN_CLICKED doesn't work. :confused:
goorley wrote:
I would like this class to handle the click event itself.
use ON_CONTROL_REFLECT() message map.
BEGIN_MESSAGE_MAP(CMyBtn, CButton)
ON_CONTROL_REFLECT(BN_CLICKED, OnClicked)
END_MESSAGE_MAP()// CMyBtn derived from CButton
void CMyBtn::OnClicked()
{
} -
goorley wrote:
I would like this class to handle the click event itself.
use ON_CONTROL_REFLECT() message map.
BEGIN_MESSAGE_MAP(CMyBtn, CButton)
ON_CONTROL_REFLECT(BN_CLICKED, OnClicked)
END_MESSAGE_MAP()// CMyBtn derived from CButton
void CMyBtn::OnClicked()
{
}