?
Solved

VB6: Suppressing default context menu in textbox

Posted on 2005-03-19
5
Medium Priority
?
347 Views
Last Modified: 2013-12-26
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
Comment
Question by:neutrinohunter
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 37

Assisted Solution

by:Harisha M G
Harisha M G earned 120 total points
ID: 13583723
0
 
LVL 5

Assisted Solution

by:Rubyn
Rubyn earned 60 total points
ID: 13585158
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
 
LVL 5

Expert Comment

by:Rubyn
ID: 13585171
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
 
LVL 4

Accepted Solution

by:
rdwillett earned 195 total points
ID: 13586904
0
 

Author Comment

by:neutrinohunter
ID: 13590480
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question