Print Page | Close Window

How to gray a CXTMenu menu item?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=966
Printed Date: 25 December 2024 at 8:28pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to gray a CXTMenu menu item?
Posted By: softz
Subject: How to gray a CXTMenu menu item?
Date 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.




Replies:
Posted By: srana
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net