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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CButton enable/disable

Status
Not open for further replies.

SteveD73

Programmer
Jan 5, 2001
109
GB
Hi

I have created an application with a disbled button. How can I enable and disable this button during runtime?

I have used the doc/view architecture.

Thank you
 
Hello CraigD

Doing run time you can use this following command:

GetDlgItem(ID_OF_BUTTON_HERE)->EnableWindow(TRUE)

This will of course enable the button. If you put in the Boolean value of FALSE in the EnableWindow(), it will disable it (dim it out so to speak). This command can be placed anywhere in your program where there is an event driven action, such as clicking a pushbutton, or a checkbox, etc, etc.

Hope this helps you out some.

Nyjil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top