Microsoft Office Tutorials and References
In Depth Information
ADD A RIGHT-CLICK MENU TO A USER FORM
AppendMenu hMenu, MF_STRING, 2, "Menu Item 2"
AppendMenu hMenu, MF_SEPARATOR, 3, ByVal 0&
AppendMenu hMenu, MF_STRING, 4, "Menu Item 3"
GetCursorPos Pt
ret = TrackPopupMenuEx(hMenu, TPM_LEFTALIGN Or TPM_RETURNCMD
Or _
TPM_RIGHTBUTTON, Pt.X, Pt.Y, hWnd,
ByVal 0&)
DestroyMenu hMenu
Select Case ret
Case 1
Call MenuProc1
Case 2
Call MenuProc2
Case 4
Call MenuProc3
End Select
End If
End Sub
Private Sub MenuProc1()
MsgBox "PopUp menu-1 is activated !"
End Sub
Private Sub MenuProc2()
MsgBox "PopUp menu-2 is activated !"
End Sub
Private Sub MenuProc3()
MsgBox "PopUp menu-3 is activated !"
End Sub
Part
3
Private Sub CommandButton1_Click()
Unload Me
End Sub
 
Search JabSto ::




Custom Search