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

Enabling and Disabling Toolbar Buttons 1

Status
Not open for further replies.

rchandr3

Programmer
Jun 16, 2003
244
0
0
US
Hi,

I am new to GUI in VC++. I use VC++ 6.0 and I want to enable/disbale particular toolbar button during runtime. It may be a silly question, but I badly need a solution!

Thanks in advance,

Ravi
 
>>It may be a silly question, but I badly need a solution!

Well surely it is not a silly question.I have gone through the same stage.

For enabling/disabling Toolbar Buttons at Runtime use SendMessage() like this:

FOR ENABLING BUTTON:
GetToolBarCtrl().SendMessage(TB_ENABLEBUTTON,<ButtonID>, (LPARAM)MAKELONG(TRUE,0));


FOR DISABLING BUTTON:
GetToolBarCtrl().SendMessage(TB_ENABLEBUTTON,<ButtonID>, (LPARAM)MAKELONG(FALSE,0));

I hope this helps!
mathu


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top