Disabling menu item 
Author Message
 Disabling menu item

Hi Jijo,

The update UI mechanism doesn't work for a dialog box-based application
because CDialog has no OnInitMenuPopup handler and it uses CWnd's default
handler, which does not call update command UI handlers for menu items.
Please check the article below for detailed information:

Q242577 PRB: Update Command UI Handlers Do Not Work Properly on Dialogs
http://www.*-*-*.com/

In addition, you may want post MFC questions to microsoft.public.vc.mfc
newsgroup.

Best Regards,
Leo Chen

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

| Subject: Disabling menu item
| Date: Thu, 29 Aug 2002 12:33:18 +0530
| Lines: 37
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

| Newsgroups: microsoft.public.vc.language
| NNTP-Posting-Host: 203.200.149.183
| Path: cpmsftngxa08!tkmsftngp01!tkmsftngp13
| Xref: cpmsftngxa08 microsoft.public.vc.language:169974
| X-Tomcat-NG: microsoft.public.vc.language
|
| Hi,
|
|     I attached a menu to a dialog through the resource editor.
| I want to make one menu item grayed.I tried to do it in the onupdate
command
| UI.
| I did the same thing with a menu in the view and it perfectly worked.
|
| void CDlg::OnUpdateSend(CCmdUI* pCmdUI)
| {
|        pCmdUI->Enable(FALSE);
| }
|
| I tried the following code also
|
| pCmdUI->Enable(FALSE);
|  CMenu *pMenu = pCmdUI->m_pMenu;
|   if(NULL!=pMenu)
|   pMenu->EnableMenuItem(ID_SEND_FILE,MF_GRAYED);
|
| The menu is disabled but not grayed.
|
| Thanks for any help
|
| Regards,
| Jijo
|
|
|
|
|
|
|
|
|
|
|
|
|



Fri, 18 Feb 2005 14:20:50 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Trying to disable Menu Item and ToolbarCtrl item..

2. Disable menu item in popup menu

3. Enabling/Disabling Menu items for a menu on a dialog application

4. Enable and Disable Menu Items

5. WTL: Enabling and disabling menu items

6. disable menu item

7. Disabling menu items in a formview

8. disabling menu items

9. Disabling Menu Items

10. Disabling Menu Items

11. Enable/Disable menu items dynamically (last question)

12. Disabling Menu Items Of CMainFrame

 

 
Powered by phpBB® Forum Software