Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Changing Menu Caption
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Changing Menu Caption

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


Joined: 18 March 2004
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdtcgriffin Quote  Post ReplyReply Direct Link To This Post Topic: Changing Menu Caption
    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

 



Edited by rdtcgriffin
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: 19 March 2004 at 6:26am
 CommandBars.ActiveMenuBar.Controls(1).CommandBar.Contr ols(2).Caption = "FileX"
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.188 seconds.