how do you disable/enable dialog buttons within code of an MFC program?
also is it possible to set whether a button is visable/not visable within the code? if so how?
:confused: :confused: :confused: :confused:
Printable View
how do you disable/enable dialog buttons within code of an MFC program?
also is it possible to set whether a button is visable/not visable within the code? if so how?
:confused: :confused: :confused: :confused:
Do you have the controls mapped to CButton objects? If so just use:
Code:m_theButton.ShowWindow(SW_HIDE); // or SW_SHOW
yep thanks parksie
that works for visable or not, but what about just disabling or "graying out" the button?
Try EnableWindow.
Code:m_button.EnableWindow (FALSE);
:( Defeated by a microsecond. :(
I'll take the microsecond any day ;)
great thanks. i scoured the MSDN for these functions with no luck. i would have thought CButton would have its own functions to perform these tasks.
It does!
Since CButton inherits from CWnd it gets those member functions.