Print Page | Close Window

Changing Menu Caption

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=546
Printed Date: 16 May 2024 at 5:44pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Changing Menu Caption
Posted By: rdtcgriffin
Subject: Changing Menu Caption
Date Posted: 19 March 2004 at 2:50am

Hello!

I have the following code to create the menu:

    Set ControlView = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 1, "File", -1, False)
    With ControlView.CommandBar.Controls
        Set Control = .Add(xtpControlButton, 2, "New", -1, False)
        .Add xtpControlButton, 3, "Open", -1, False
        .Add xtpControlButton, 4, "Close", -1, False
    End With

Then, later on I would lile to change the captions of the menu. For the main menu (File) I can change teh caption using:

    CommandBars.ActiveMenuBar.Controls.Item(1).Caption = "FileX"

But for it's submenus, I get "Invalid procedure call or argument" error message when I try this:
    CommandBars.ActiveMenuBar.Controls.Item(2).Caption = "OpenX"

What method should I use so that I can change the captions? Also, is the solution the same for toolbars?

Thanks in advance!

Rommel

=========

sorry, should have posted in VB area

 




Replies:
Posted By: Oleg
Date Posted: 19 March 2004 at 6:26am
 CommandBars.ActiveMenuBar.Controls(1).CommandBar.Contr ols(2).Caption = "FileX"

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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