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
 
 
 
 
 
TitleGive a form a popup menu
Keywordspopup menu, context menu, right click
CategoriesControls, Tips and Tricks
 
In the menu editor, create a menu named mnuPopup. Set its Visible property to False and give it the menu items you want to display on the popup.

In the form's MouseDown event handler, look for the right mouse button. When you see it, use the PopupMenu command to display the popup menu.

 
' On right click, display the popup.
Private Sub Form_MouseDown(Button As Integer, Shift As _
    Integer, X As Single, Y As Single)
    If Button = vbRightButton Then
        PopupMenu mnuPopup
    End If
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated