Owner Drawn button does not get messages
-
I have changed the properties of the existing regular button to owner-drawn. changed the button variable to custom type that's derived from CButton. In my custom type class I am handling DrawItem. But now this button stays flat and I cannot press it. While I debug I notice that I do get the DrawItem notification but when I click on the button, I am not able to draw the sunk button. Also, I cannot execute the on-btn-click event. What am I missing?
-
I have changed the properties of the existing regular button to owner-drawn. changed the button variable to custom type that's derived from CButton. In my custom type class I am handling DrawItem. But now this button stays flat and I cannot press it. While I debug I notice that I do get the DrawItem notification but when I click on the button, I am not able to draw the sunk button. Also, I cannot execute the on-btn-click event. What am I missing?
you should write the class detail.
-
I have changed the properties of the existing regular button to owner-drawn. changed the button variable to custom type that's derived from CButton. In my custom type class I am handling DrawItem. But now this button stays flat and I cannot press it. While I debug I notice that I do get the DrawItem notification but when I click on the button, I am not able to draw the sunk button. Also, I cannot execute the on-btn-click event. What am I missing?
on-btn-click event is not an event. It is a handler for WM_COMMAND message and BN_CLICKED notification code receives as message parameter. Are you by any chance handling WM_LBUTTONDOWN or WM_LBUTTONUP? If yes, do you call base class handler? You should perform all custom drawing in DrawItem function. Is it a case?
JohnCz