Click to See Complete Forum and Search --> : how to enable a button in a dialogbar?


May 12th, 1999, 09:42 AM
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!

BrianOG
May 12th, 1999, 10:50 AM
that should be enough.... where have you added the handler (i.e. to which class)?

Dan Haddix
May 13th, 1999, 02:12 AM
EnableWindow(TRUE); enables a button and EnableWindow(FALSE); disables a button.

June 30th, 1999, 12:47 PM
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 venkatthegiga@yahoo.com

Brian Budge
June 30th, 1999, 01:01 PM
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