Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you disable the right mouse click inside a TextBox

Tags:

c#

winforms

mouse

How do you disable the right mouse click inside a TextBox?

like image 908
ehsan_d18 Avatar asked Oct 01 '10 02:10

ehsan_d18


2 Answers

You can just set the context menu to a new ContextMenu

    textBoxt1.ContextMenu = new ContextMenu();
like image 101
SwDevMan81 Avatar answered Oct 23 '22 21:10

SwDevMan81


A neater solution might be to just disable the 'ShortcutsEnabled' property of the textbox as described here.

It would be a shame both scientifically and philosophically to create a whole object that has absolutely no purpose in life.

like image 42
LordWilmore Avatar answered Oct 23 '22 20:10

LordWilmore