|
|||||||
|
|
|
|||||
|
|
|||||||
Preparations:
1. Create a menu named as 'MnuFile' with properties as below:
Visibled
= False
2. Add at least one submenu into it
Codes:
'Declare API functions in a module
Public Declare Function SetForegroundWindow Lib "user32" _
(ByVal hwnd As Long) As Long
'Add following codes into a form
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim Result As Long
If Button = 2 Then
Result = SetForegroundWindow(Me.hwnd)
PopupMenu mnuFile
End If
End Sub
Copyright (c) 1999 - 2001, robert han, all rigths are reserved.