Toolbar button state during command execution
Iain Waddell -- iain@cix.compulink.co.uk
Monday, April 01, 1996
Windows NT 3.51/SP3 Visual C++ v4.0
In Visual C++ v2.x when a toolbar command was executing the button would
remain depressed. In Visual C++ v4.0 the button only stays depressed
while the mouse button is held down.
I would like to be able to reproduce Visual C++ v2.x functionality using
Visual C++ v4. Does anybody know how this can be done. I have tried
setting the toolbar button style to TBBS_PRESSED from within the command
handler but this does not work.
Iain Waddell (iain@cix.compulink.co.uk)
Robertson David -- davidr@devmail.sps.mot.com
Wednesday, April 03, 1996
[Mini-digest: 2 responses]
In Visual C++ v2.x when a toolbar command was executing the button would
remain depressed. In Visual C++ v4.0 the button only stays depressed
while the mouse button is held down.
I would like to be able to reproduce Visual C++ v2.x functionality using
Visual C++ v4. Does anybody know how this can be done. I have tried
setting the toolbar button style to TBBS_PRESSED from within the command
handler but this does not work.
Iain Waddell (iain@cix.compulink.co.uk)
// When you want the button to look pressed...
int nIndex = pToolBar->CommandToIndex(ID);
UINT prevStyle = pToolBar->GetButtonStyle(nIndex);
pToolBar->SetButtonStyle(nIndex,
prevStyle | (TBBS_CHECKBOX | TBBS_CHECKED));
// When you want the button to look normal...
pToolBar->SetButtonStyle(nIndex, prevStyle);
-----From: Rih Saad
I didn't test this and i don't know how much it will cost you but you can
try it. In your OnUpdate Handler for the Button Call SetCheck(TRUE) if
running the command and SetCheck(FALSE) otherwise.
Rih Saad
Wind Systeme
| Вернуться в корень Архива
|