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

How to modify menu item text

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


Joined: 11 May 2009
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote ld88888 Quote  Post ReplyReply Direct Link To This Post Topic: How to modify menu item text
    Posted: 11 May 2009 at 5:11am
OnCreate Function:
 
CXTPCommandBars* pCommandBars = GetCommandBars();
 if(pCommandBars == NULL)
 {
  TRACE0("Failed to create command bars object.\n");
  return -1;      // fail to create
 }
 
CXTPCommandBar* pMenuBar = pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINFRAME);
 
 
How to modify menu Item text?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 12 May 2009 at 2:14am
Hi,
 
Please check samples in CommandBars folder. They have all you need.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
ld88888 View Drop Down
Newbie
Newbie


Joined: 11 May 2009
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote ld88888 Quote  Post ReplyReply Direct Link To This Post Posted: 12 May 2009 at 11:04am

please tell me which sample can achieve this function?

all over the samples I have run, but I haven't found the fit one.

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 12 May 2009 at 3:38pm
For example Samples\CommandBars\Notifications uses code to add controls dynamically.
 
You need somehing like
 
pMenuBar->GetControl(0)->SetCaption("new Caption")
or
pMenuBar->GetControl(0)->GetCommandBar()->GetControl(0)->SetCaption("new Caption")
 
see CXTPControls/CXTPControl class description for details.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
ld88888 View Drop Down
Newbie
Newbie


Joined: 11 May 2009
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote ld88888 Quote  Post ReplyReply Direct Link To This Post Posted: 14 May 2009 at 6:27am
Thanks you very much!
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.051 seconds.