Click to See Complete Forum and Search --> : Popupmenu in textboxes


Michael Hartmann
February 23rd, 2000, 07:16 AM
Hello everybody,

I need your help. When clicking with the right mousebutton on a textbox creates a popupmenu with items like Cut, Copy, Paste an so on. Is there anything I can do to disable this popupmenu. I thin I have to set an exteded style for the textbox with the API function SetWindowLong, but I don't know how this function has to be called to do the right thing. I hope somebody could help me with this.

Best regards

Michael Hartmann

TH1
February 23rd, 2000, 07:40 AM
The proper way would be to subclass it.
I'm not sure of how to remove the menu completely but have a look at Randy Birch's site http://www.mvps.org/vbnet
This may give you some tips.
If all you want to do is use your own popup menu that do the following.

private Sub Text1_MouseDown(Button as Integer, Shift as Integer, X as Single, Y as Single)
Text1.Enabled = false
PopupMenu Mymenu
Text1.Enabled = true
End Sub



This will replace the default menu with your own popup menu.
Hope this helps.