Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - How to Change menu item text
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to Change menu item text

 Post Reply Post Reply
Author
Message
DPDP View Drop Down
Newbie
Newbie


Joined: 25 August 2005
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote DPDP Quote  Post ReplyReply Direct Link To This Post Topic: How to Change menu item text
    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,
 

Back to Top
Raj.krishnan View Drop Down
Groupie
Groupie
Avatar

Joined: 16 January 2006
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote Raj.krishnan Quote  Post ReplyReply Direct Link To This Post 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);

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.141 seconds.