I have a button in my dialogbar which is grayout. How do I enable the button?
I added a handler to handle the event of the button being clicked. What else I should do?
Thanks!
Printable View
I have a button in my dialogbar which is grayout. How do I enable the button?
I added a handler to handle the event of the button being clicked. What else I should do?
Thanks!
that should be enough.... where have you added the handler (i.e. to which class)?
EnableWindow(TRUE); enables a button and EnableWindow(FALSE); disables a button.
Please add a variable to the button thru class wizard . Suppose the name is
m_Button. Then in your code you can write
m_Button.EnableWindow(TRUE);//to enable the window
m_Button.EnableWindow(FALSE);//to disable the window
reply to [email protected]
When you decide to enable the button you could say
CButton* button = (CButton*)dialogBar.GetDlgItem(IDC_BUTTON_RESOURCE_NAME_HERE);
button->EnableWindow(true);
correspondingly if you needed to disable you would replace the true with a false