Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 358
  • Last Modified:

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

0
neutrinohunter
Asked:
neutrinohunter
3 Solutions
 
Harisha M GCommented:
0
 
RubynCommented:
Place one text box on the form
Place a menu for pop up

Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
    Text1.Enabled = False
    Call PopupMenu(mnu)
    Text1.Enabled = True
End If
End Sub
0
 
RubynCommented:
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
0
 
neutrinohunterAuthor Commented:
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
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now