Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 455
  • Last Modified:

Disable a Button on a toolbar

I am having trouble disabling buttons on a toolbar made with the resource editor in Visual C++.

I am trying to disable certain buttons on the bar when a setting is changed.
I am running the below code in the frame of the MDI child window.

CToolBarCtrl * pTBCtrl = &m_wndTimeLineBar.GetToolBarCtrl();
pTBCtrl->EnableButton(ID_VIEW_EVENTS,0);

The code runs with no errors, but doesn't appear to do anything.
0
JoyBurke
Asked:
JoyBurke
1 Solution
 
AndyAinscowCommented:
Hava an ON_UPDATE_COMMAND_UI handler

eg.
void CPaymentFrame::OnUpdateMyfilePrint(CCmdUI* pCmdUI)
{
      pCmdUI->Enable(false);      //not available
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now