[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Set state of toolbar button?

Posted on 2001-08-17
1
Medium Priority
?
716 Views
Last Modified: 2013-11-20
Hi and thank for your time to read my question,

I am using VC6, I have a workspace: CMyApp, and have a toolbar in CMainFrame. I want to set the button of this toolbar to HIDDEN from CMyAppView class, or CMyAppDoc class, but I don't know how the way.

I tried declare a static CToolbar's variable at CMainForm, and in CMyAppView, I call this static variable for my purpose, but not successful.

Pls help me.
Best regards and thanks in advance.
0
Comment
Question by:vinhdh
[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
 

Accepted Solution

by:
resham earned 200 total points
ID: 6399781
Hi,

You can access MainFrame's members in ur application by calling AfxGetMainWnd().

Here is the sample code
In view class

CMainFrame *pMainFrm = (CMainFrame*) AfxGetMainWnd();
CToolBar& toolBar = pMainFrm->GetToolBar();
CToolBarCtrl& tbCtrl = toolBar.GetToolBarCtrl();

//To hide the  button
tbCtrl.HideButton(ID_FILE_PRINT, FALSE);

And in MainFrame Class
CToolBar& CMainFrame::GetToolBar()
{
     return m_wndToolBar;
}


Hope this will help.

Resham

0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

649 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