Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I get a ComboBox ContextMenu

Status
Not open for further replies.

er13b6ac

Programmer
Jun 3, 2002
5
US
When I right click on my ComboBox control, a shortcut menu is displayed. How do I get access to the control's ContextMenu so I can program the menu items?

I see this explained in .net but not VB 6.
 
In VB they are called Popup Menus, What you do is use the menu editor to create a menu, but untick the visible box. The add code similar to that below, however I am not sure if they can be used on combo boxes. You will have to test it. You can also search VB help for Popup Boxes.

Private Sub Form_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
PopupMenu mnuFile
End If
End Sub

Hope it helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top