Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disableing Controls 1

Status
Not open for further replies.

zoomerx

Programmer
Jul 20, 2004
6
US
Hi all!
How do I disable Controls when I press a button?
I am makine a MFC Dialog Application and it has multiple controls on it. I was wondering how I could use a button to disable all the buttons, and progress bars. I also have 2 tabsets, I would like those to also be disabled when I push the button. When I click the button again I want the controls to be enabled.
Thanks In Advance!
 
You need to create an event handler for your button. In the event handler, you can disable other controls by calling EnableWindow() for each control.

If the control is represented by a CWnd* in your dialog, call EnableWindow() directly on that. Otherwise, call GetDlgItem() with the control's ID, and call EnableWindow() through the temporary pointer it returns.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top