Posted on July 9, 2011
1
2
3
4
5
6
7
8
9
| 'Forms - How to create a popup menu
'Simple short piece of VB code which demonstrates how to create a popup menu.
'Put the following code in the form's MouseDown event
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then ' if right mouse button is pressed
PopupMenu mnuFile ' popup mnuFile
End If
End Sub |