Results 1 to 3 of 3

Thread: Menu in VB (VB)

  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Menu in VB (VB)

    I am wondering how I can create a menu using the menu editor in VB that can have those little icons (like the diskette, open folder) on the left hand side.

    Thanks

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Menu in VB (VB)

    Not sure how to use the menu editor to do it, but you can code it up yourself: Add a CommandBarPopUp object to the CommandbarControl (your app toolbar). Then for each "popup" (I would have called it a popout) menu add a button and include a .FaceID property for the icon you want.

    Here's a sample to give you the idea: (this code was used in a VBA project, but should work in VB)

    Dim AppPopupMenu As CommandBarControl
    Dim MenuPopUp As CommandBarPopup
    Dim MenuButton As CommandBarButton
    Dim MenuControl As CommandBarControl
    [pre]
    Set AppPopupMenu = cBar.Controls.Add(Type:=msoControlPopup, Before:=cBar.Controls("Help").Index, Temporary:=True)
    With AppPopupMenu
    .Caption = "My App ToolBarl"
    .TooltipText = TOOLBARNAME & " " & PRODUCTVERSION
    .DescriptionText = "Yada yada yada"
    .OLEUsage = msoControlOLEUsageNeither
    End With

    Set MenuPopUp = AppPopupMenu.Controls.Add(Type:=msoControlPopup, ID:=1, Temporary:=True)
    With MenuPopUp
    .BeginGroup = True
    .Caption = "Name of PopUp Menu"
    .TooltipText = "Tooltip text"

    Set MenuButton = .Controls.Add(Type:=msoControlButton, Temporary:=True)
    With MenuButton
    .Caption = "1st PopUp (out) Menu Item..."
    .FaceId = 1750
    .Tag = .Caption
    .OnAction = "1st_popup"
    End With

    Set MenuButton = .Controls.Add(Type:=msoControlButton, Temporary:=True)
    With MenuButton
    .Caption = "2nd PopUp Menu Item..."
    .FaceId = 364
    .Tag = .Caption
    .OnAction = "2nd_PopUp"
    End With

    Set MenuButton = .Controls.Add(Type:=msoControlButton, Temporary:=True)
    With MenuButton
    .Caption = "3rd PopUp Menu Item..."
    .FaceId = 487
    .Tag = .Caption
    .OnAction = "3rd_PopUp"
    End With


    End With
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Menu in VB (VB)

    Thanks. I will give it a try this weekend.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •