ComboBox alternative

How can I design something like the menu bar or the start button that I can use in place of the combo box?

Thanks
Gamestor
gamestorsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JuiletteCommented:
You'll have to clarify that.
A combo you fill with items..a menubar or a command is a tool for starting an event.
What combobox? What are you trying to do?
Wayne
0
Erick37Commented:
This will display a PopupMenu at the bottom of a CommandButton:

Private Sub Command1_Click()
'Popup the menu
PopupMenu mnuPopup, 0, Command1.Left, _
        Command1.Top + Command1.Height
End Sub

Create an invisible menu item named mnuPopup with the desired sub-menus (using the menu editor tool).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gamestorsAuthor Commented:
Erick,

Is this the only way to do it?

0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

JuiletteCommented:
Like I asked? what are you trying to do?
There could be lots of alternatives.
0
gamestorsAuthor Commented:
How can I create the invisible menu iteM?  I mean which comonent do I use?  I can't find a specific one that has the menu control.

Thanks
0
gamestorsAuthor Commented:
Juilette,

I can generate an event from a combo box.  I want to click on a button to drop down a menu that branches to other options so I can select and item to generate an event.

0
JuiletteCommented:
'Building a popup menu
'menu editor is a right click on form in design time or tools ..menu editor
 
'1) Use the menu editor and create this menu

     mnuPopUpMenuExample
     ....mnuShowMe
     ....mnuWorks
     ....mnuExit

2) Paste this code into the form window

Private Sub Form_Load()
   
'if you leave the menu invisible on building you don't need this
   'line of code in the form load event

   mnuPopUpMenuExample.Visible = False

End Sub

Private Sub Form_MouseUp(Button As Integer, _
        Shift As Integer, X As Single, Y As Single)
   
  If Button = 2 Then
     'puts popup in the middle of the application form

    PopupMenu mnuPopUpMenuExample, 0, frmMain.ScaleWidth / 3, frmMain.ScaleHeight / 3
 
End If
   
End Sub


 
0
JuiletteCommented:
'Building a popup menu
'menu editor is a right click on form in design time or tools ..menu editor
 
'1) Use the menu editor and create this menu

     mnuPopUpMenuExample
     ....mnuShowMe
     ....mnuWorks
     ....mnuExit

2) Paste this code into the form window

Private Sub Form_Load()
   
'if you leave the menu invisible on building you don't need this
   'line of code in the form load event

   mnuPopUpMenuExample.Visible = False

End Sub

Private Sub Form_MouseUp(Button As Integer, _
        Shift As Integer, X As Single, Y As Single)
   
  If Button = 2 Then
     'puts popup in the middle of the application form

    PopupMenu mnuPopUpMenuExample, 0, frmMain.ScaleWidth / 3, frmMain.ScaleHeight / 3
 
End If
   
End Sub


 
0
gamestorsAuthor Commented:
But I already have the menu for the main form.  I don't think I can create the second one.

0
Erick37Commented:
You do not create a separate menu, you add another menu item to your existing menu, just like any other menu item.  The only difference is that you uncheck the visible checkbox (in the menu editor) so that the new menu item is not visible on the main menu bar.  Only make the top level menu item invisible.  Then you call PopupMenu with the name of the invisible top-level menu item.
0
JuiletteCommented:
Use a second form...call it frmPopup
Build the menu on it and set it's visible property to false (uncheck the visible box)

Private Sub Form_MouseUp(Button As Integer, _
        Shift As Integer, X As Single, Y As Single)
   
  If Button = 2 Then
     'puts popup in the middle of the application form

    PopupMenu frmPopup.mnuPopUpMenuExample, 0, frmMain.ScaleWidth / 3, frmMain.ScaleHeight / 3
   
End If
   
End Sub
'don't forget to change all the names to correspond to what you are using..ie..frmMain is your main form and frmPopup will be your popup form

0
gamestorsAuthor Commented:
Great....I understand now.  Can I grade both?:)

0
JuiletteCommented:
I don't  think so...flip a coin...no biggie to me...ask Erick his opinion.
'Wayne
0
Erick37Commented:
I'll take heads :-))
0
JuiletteCommented:
Gamestor has the ball (coin) now..
Bye
Wayne
0
gamestorsAuthor Commented:
Ok....Heads..

Thanks to both

Gamestor
0
Erick37Commented:
Thanks!
Glad to help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.