Solved

Menu Bars

Posted on 1998-06-29
2
172 Views
Last Modified: 2013-11-20
In my MFC application, I want to grey out several fields in my "File" pulldown on the main menubar.   Yet, I have gone to the resource view and specified in the properties that each of these fields should be "greyed out", but it doesn't seem to work.   FYI, these are the "open" and "close", plus all of the "VIEW" characteriestics? Is there something that I'm missing?

Thanks
0
Comment
Question by:mulshine
2 Comments
 
LVL 1

Accepted Solution

by:
motigust earned 30 total points
ID: 1318495
The right way to do it is to handle the UPDATE_COMMAND_UI message.

Use the wizard to generate a function for your items.

for example: to ovveride the UI message for file open:

BEGIN_MESSAGE_MAP(CMyApp, CWinApp)



ON_UPDATE_COMMAND_UI(ID_FILE_NEW, OnUpdateFileOpen)



END_MESSAGE_MAP()




void OnUpdateFileOpen(CCmdUI* pCmdUI){
 pCmdUI->Enable(FALSE);
}

0
 

Author Comment

by:mulshine
ID: 1318496
thanks. it worked
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

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…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.

809 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