Print Page | Close Window

Change Menu at Runtime

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=162
Printed Date: 02 May 2024 at 7:27am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Change Menu at Runtime
Posted By: clintsinger
Subject: Change Menu at Runtime
Date Posted: 16 September 2003 at 5:23pm

Hi,

I would like to be able to take the MenuBar and change what is in it at runtime.

In the OnCreate of MainFrm.cpp we have the following line.

CXTPCommandBar* pMenuBar = pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINFRAME);

How do I get the MenuBar as a CMenu* object so I can modify it at runtime?

Cheers,

Clint




Replies:
Posted By: Oleg
Date Posted: 17 September 2003 at 12:12am

You can modify CXTPCommandBar at runtime.

Use CXTPCommandBar::GetControls() method to take collection of MenuBar's controls.




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