Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleMake a popup menu
DescriptionThis example shows how to use a popup menu in Visual Basic 6.
Keywordspopup menu, popup, context menu, PopupMenu
CategoriesControls, Software Engineering
 
Make a top-level menu and set its Visible property to False.

In the MouseDown event handler where you want to display the menu, make sure the right button is pressed and then use PopupMenu to display the menu.

 
Private Sub Form_MouseDown(Button As Integer, Shift As _
    Integer, X As Single, Y As Single)
    ' Make sure it's the right button.
    If Button And vbRightButton Then PopupMenu mnuPopup
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated