I have a dialog based application. I have one static text control and a button on this, both of which I have made invisible in the beginning. I want to show both the controls on reaching a certain condition. When I click this button, again I want to make both the controls invisible.
However, I am able to show and hide the control and also captured the button click event like this:
and defined OnBnClickedMyButton().
But when I press the button, it is not pressed and the event is also not generated.
IDC_MY_BUTTONexists and is valid.
DECLARE_MESSAGE_MAP()at the header file.
BEGIN_MESSAGE_MAP(MyClass,MyParentClass)if the class and the parent class you write are right.
I hope this helps.
I think the
IDC_MY_BUTTON maybe is invalid or other control has the same ID.
Well, finally I have come to know that though the button was visible but on clicking it was not taking control, hence I used
BringWindowToTop() to draw it on top. Now it is being clicked and
OnBnClickedMyButton() is also being called.
But now the issue is that after calling
BringWindowToTop() the button is not shown. It is shown only when I take the mouse pointer on it. Not able to understand what is the issue.