Print Page | Close Window

How to modify 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=14260
Printed Date: 27 February 2025 at 11:22pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to modify menu item text
Posted By: ld88888
Subject: How to modify menu item text
Date 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?



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


Posted By: ld88888
Date 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.



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


Posted By: ld88888
Date Posted: 14 May 2009 at 6:27am
Thanks you very much!



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