Solved

Disable a Button on a toolbar

Posted on 2003-11-18
1
446 Views
Last Modified: 2013-11-20
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
Comment
Question by:JoyBurke
1 Comment
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 75 total points
ID: 9772753
Hava an ON_UPDATE_COMMAND_UI handler

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now