Solved

Disable a Button on a toolbar

Posted on 2003-11-18
1
451 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses

623 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