Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CExtToolControlBar - How to keep the button in 'pressed' state? Collapse All
Subject Author Date
Kit Kwan Sep 5, 2006 - 10:48 AM

Hi, I’m able to create and load the tool bar just fine. After I click a button in the toolbar, I want it to remain in ’pressed’ state, so that I know it has been activated. I looked at the sample apps like BitmapEditor and DRAWCLI, but I don’t notice any setting, but their toolbar buttons can do that. I pretty much copied the sample code. What am I missing?
Thanks!

Technical Support Sep 7, 2006 - 7:37 AM

Please add the ON_UPDATE_COMMAND_UI handler for the command:

afx_msg void OnUpdateYourCommand(CCmdUI* pCmdUI);

...
 
ON_UPDATE_COMMAND_UI(ID_YOUR_COMMAND, OnUpdateYourCommand)
 
...
 
void CMainFrame::OnUpdateYourCommand( CCmdUI * pCmdUI ) 
{
 pCmdUI->SetCheck( m_bChecked ? 1 : 0 );
}