Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - How to gray a CXTMenu menu item?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to gray a CXTMenu menu item?

 Post Reply Post Reply
Author
Message
softz View Drop Down
Newbie
Newbie
Avatar

Joined: 29 December 2003
Location: Singapore
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote softz Quote  Post ReplyReply Direct Link To This Post Topic: How to gray a CXTMenu menu item?
    Posted: 22 July 2004 at 12:59am

Hi,

Please help...

I've a menu shown as below (for example).

CXTMenu menu;
menu.LoadMenu(IDR_MENU);
CXTMenu* pSubMenu = menu.GetSubMenu(0);
pSubMenu->EnableMenuItem(ID_MENU_ITEM1,
                                                MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
CXTPCommandBars::TrackPopupMenu(pSubMenu, 0, pos.x, pos.y, this);

I'm using the code for a pop-up menu. Unfortunately, it failed to disable the menu item. May I know how could I disable a menu item if I'm using the CXTMenu?

Regards.

Back to Top
srana View Drop Down
Groupie
Groupie
Avatar

Joined: 15 May 2003
Location: India
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote srana Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2004 at 9:37pm

They are like notmal menus. You have to handle on

ON_UPDATE_COMMAND_UI(ID_MSG_XX, OnMSGXX)

void CLassName::OnMSGXXCCmdUI *pCmdUI)

{

pCmdUI->Enable(false);

}


Shrishail Rana
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.219 seconds.