Click here to Skip to main content
15,896,201 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using the Right Mouse click to launch a popup menu, but when I Right Mouse click in the TextBox, a menu appears:

Undo (Grayed)
Cut (Grayed)
Copy (Grayed)
Paste
Delete (Grayed)
Select All
Right to left Reading order
Show Unicode control characters (Grayed)
Insert Unicode control character> (Grayed)
Open IME
Reconversion (Grayed)

After hitting the Esc key, then my popup menu appears.
I have no idea where this is coming from or how to stop it.

Any ideas?
Posted

It is the default pop-up menu for a TextBox in VB6.

There is no direct way to suppress it but this article[^] shows a way around it
 
Share this answer
 
Thanks CHill60,

I was able to do this:

In a Module:
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _
ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByRef lParam As Any) As Long

Public Const WM_RBUTTONDOWN As Long = &H204
Public bolRightClicked As Boolean


In my Form:
Private Sub Text1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)

Select Case Button
Case 1 'Left
Case 2 'Right
bolRightClicked = False
SendMessage Me.hwnd, WM_RBUTTONDOWN, 0, 0&
PopupMenu mnuPopUp2
Case 4 'Middle
End Select

End Sub

Thanks for your "Push" in the right direction!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900