Print Page | Close Window

How to Change menu item text

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=3543
Printed Date: 04 March 2025 at 5:27pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to Change menu item text
Posted By: DPDP
Subject: How to Change menu item text
Date Posted: 20 January 2006 at 6:42pm

I used to be able to get the CFrameWnd's menu, and change one menu item text from "ABC" to "XYX" as follows

CMenu* pMenu = GetMenu();
if (...)
   pMenu->ModifyMenu(ID_APP_ABOUT, MF_BYCOMMAND, ID_APP_ABOUT, "&About ABC...");
else    // Rename menu item "About ABC..." to "&About XYZ...".
    pMenu->ModifyMenu(ID_APP_ABOUT, MF_BYCOMMAND, ID_APP_ABOUT, "&About XYZ...");

How should I do using CXTPCommandBars?

Thanks,
 




Replies:
Posted By: Raj.krishnan
Date Posted: 03 April 2006 at 4:53am

Hi,

You need to handle it on ON_UPDATE_COMMAND_UI message for the particlar menu item

CCmdUI *pCmdUI will come in this message as argument

set the text using     pCmdUI->SetText(CString);




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