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 » Can't disbale toolbar button Collapse All
Subject Author Date
Dan Heinz Dec 28, 2004 - 11:28 AM

I have a dialog with a toolbar (set up like your ProfUIS_Controls sample).


I can’t seem to disable any of the toolbar buttons.  I added this code to your sample in the OnInitDialog() right after this line:


 VERIFY(
  g_CmdManager->SetBasicCommands(
  pApp->m_pszProfileName,
  g_statBasicCommands
  )
  );


Here’s the code to disable a button:


 CExtBarButton* pBut = m_wndToolBar.GetButton(5);
 pBut->ModifyStyle(TBBS_DISABLED);


It does not work.  The other TBSS_... styles do work when I call ModifyStyle - just TBBS_DISABLED does not work.  What am I missing?


 


 

Dan Heinz Dec 28, 2004 - 12:49 PM

Ah, nevermind - got it working.  Once I added the command update UI handlers all is right with the world.

Technical Support Dec 29, 2004 - 1:54 AM

You are absolutely right. The state of buttons inside the CExtToolControlBar window is fully controlled by the command update mechanism of MFC.

Happy holidays! :)