Click to See Complete Forum and Search --> : Text Box


krupeshreddy
August 5th, 1999, 02:00 PM
At run time when I click right mouse button I get a default popup menu with options like cut,copy,delete. How to prevent this menu to appear


Thanks

krr

August 5th, 1999, 02:09 PM
What does this question have to do with TextBox?

Andy K.
August 5th, 1999, 06:37 PM
I don't think there is a way to do it, because it's default windows function, when you right-click onto a textbox, it shows pop-up menu

Ravi Kiran
August 5th, 1999, 10:35 PM
I remember seeing some code on Vbthunder site.
Check it out: http://www.vbthunder.com

RK

Ravi Kiran
August 6th, 1999, 01:19 AM
You can subclass the textbox and look for WM_RBUTTONDOWN and eat it way.!! Also there are a couple of samples on Codeguru.com/vb section that shows how to display other menus as well.

Here is one such link, from there.
http://www.mvps.org/vbnet/code/subclass/contextmenu.htm

RK

August 7th, 1999, 12:32 PM
I made a PopUpMenu for a listbox in one of my programs. First, make a menu(in menu editor), make it hidden. In the projects, doubleclick the textbox(to edit the code), and make it MouseDown. Look at this:
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
PopupMenu menur 'menur should be replaced with whatever you named yoru menu
End If
End Sub
It doesn't work for the textbox(i don't think), but try to work with this code. If you change the button to 1, then it'll work for the left mousebutton

Che