Solved

Disable a Button on a toolbar

Posted on 2003-11-18
1
444 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
Comment Utility
Hava an ON_UPDATE_COMMAND_UI handler

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

743 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

8 Experts available now in Live!

Get 1:1 Help Now