Link to home
Start Free TrialLog in
Avatar of neutrinohunter
neutrinohunterFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VB6: Suppressing default context menu in textbox

Hi, i am having a few problems with the Textbox control.

I want to disable the default context menu in the control WITHOUT displaying one of my own in.

I have tried looking on google and many examples, ones that do not include a menu do not seem to work.

I have the following alternatives:

1) Change every TextBox to RichTextBox control, which means changing roughly 200 controls.
2) Display this menu somewhere off screen (don't know whether this is possible as a pop up menu requires interaction before becoming invisible)
3) Using Subclassing, which does not seem to work.

Are there any other alternatives that i haven't tried, or any code that you have that will solve this problem

Thanks in advance

Neutrinohunter

SOLUTION
Avatar of Harisha M G
Harisha M G
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rubyn
Rubyn

This will be better

Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
    Text1.Enabled = False
    Text1.Enabled = True
    Call PopupMenu(mnu)
End If
End Sub
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of neutrinohunter

ASKER

mgh: Get a problem with AddressOf Operator
Rubyn: Brings up both menus
Rdwillet: brings up original textbox in the first.

I have found what i wanted from another topic i thought id closed, so split points.

Thanks

Neutrinohunter