|
Another way to prevent the Default Context menu appearing in a TextBox
Submitted by Rick Rothstein |
Applies To |
|
| OS: VB: |
NT, 9x, 2000 5, 6 |
|
| Add the following to a .BAS, .FRM or .CLS |
|---|
'Place in General declarations
Private Declare Function ReleaseCapture Lib "user32" () As Long
'Place the following code for every textbox where you want to overide the
'default context menu.
Private Sub Text1_MouseDown(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
ReleaseCapture
PopupMenu mnuYourPopUpMenuName
End If
End Sub