Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - VB Menu
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

VB Menu

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


Joined: 22 June 2004
Location: India
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote amolrajurkar Quote  Post ReplyReply Direct Link To This Post Topic: VB Menu
    Posted: 22 June 2004 at 6:55am

How can i create menu in vb using Xtreme Commandbars please post a small example

 

 

Thank you

 

Amol

Amol Rajurkar
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 22 June 2004 at 7:04am
Take a look at any of the CommandBars sample projects, they include all of the code you need to create a menu.

What type of menu are you looking to create?  Can you be more specific?  This way I can point you to the appropriate sample, or post some sample code.
Back to Top
amolrajurkar View Drop Down
Newbie
Newbie


Joined: 22 June 2004
Location: India
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote amolrajurkar Quote  Post ReplyReply Direct Link To This Post Posted: 22 June 2004 at 7:11am

sample are not clear to understand me,

I want a small sample add a menu, sub menu and menu items only

 

Amol Rajurkar
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 22 June 2004 at 7:31am
This small sample illustrates how to add a popup menu to the menubar called "File" and how to add items to the "File" popup menu.  The "New" menu item added to the "File" popup menu will have a submenu that popups up displaying more menu items.

'Place these constants in the General code section, they are used to identify each menu item.   You will use this id to determine which menu item was clicked, when you are trying to find an item, when you need to update the status of an item, etc....

Const ID_FILE_NEW = 100
Const ID_FILE_OPEN = 101
Const ID_FILE_CLOSE = 102
Const ID_FILE_SAVE = 103
Const ID_FILE_EXIT = 104
Const ID_FILE_NEW_WINDOW = 105
Const  ID_FILE_NEW_TAB = 106

'Place this code in the Form_Load event.  This will add a simple menu to the menubar.   No toolbar is added in this sample.

Private Sub Form_Load()
    Dim Control As CommandBarControl
    Dim ControlFile As CommandBarPopup
    Dim ControlNew As CommandBarPopup
    
    Set ControlFile = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&File", -1, False)
    With ControlFile.CommandBar.Controls
        Set ControlNew = .Add(xtpControlPopup, 0, "&New")
        ControlNew.Com mandBar.Controls.Add xtpControlButton, ID_FILE_NEW_WINDOW, "New Navigator"
        ControlNew.CommandBar.Controls.Add xtpControlButton, ID_FILE_NEW_TAB, "New Tab"

        .Add xtpControlButton, ID_FILE_OPEN, "&Open"
 
       Set Control = .Add(xtpControlButton, ID_FILE_CLOSE, "&Close")
        Control.BeginGroup = True
 
        .Add xtpControlButton, ID_FILE_SAVE, "&Save", -1, False
             
        Set Control = .Add(xtpControlButton, ID_FILE_EXIT, "&Exit", -1, False)
        Control.BeginGroup = True
    End With
End Sub

I hope this helps, I tried to keep it simple.  Let me know if you need help using this menu, or if you need help adding a toolbar


Edited by SuperMario
Back to Top
amolrajurkar View Drop Down
Newbie
Newbie


Joined: 22 June 2004
Location: India
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote amolrajurkar Quote  Post ReplyReply Direct Link To This Post Posted: 22 June 2004 at 7:43am

Thank you for the code its working g8t.

Thanks a lot.

Amol Rajurkar
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.156 seconds.