
Originally Posted by
RobertLees
I want to create a popup menu. There will be a variable number of items in the popup menu (dont know how many). If an item is clicked, some action might be performed (I'll work that out), but a sub-popup menu might need to be produced. Can anyone get me started ?
add your menu (and submenus) to the menu editor
hide the menu with mnuName.visible=false (mnuName being the name of the menu)
then all you have to do is do this: (put it in a mousedown event)
using right mouse button (on form)
VB Code:
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
PopupMenu mnuName
End If
End Sub
using left mouse button (on form)
VB Code:
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
PopupMenu mnuName
End If
End Sub