winforms - How to disable the right-click context menu on textboxes in Windows, using C#? -
how disable right-click context menu on textboxes in windows, using c#? here's i've got, has errors.
private void textbox1_mousedown(object sender, mouseeventargs e) { if (e.button == mousebuttons.right) { textbox1.contextmenu.dispose(); } }
try
textbox1.shortcutsenabled =false; use
shortcutsenabledproperty enable or disable following shortcut key combinations , control’s shortcut menu:
ctrl+z
ctrl+e
ctrl+c
ctrl+y
ctrl+x
ctrl+backspace
ctrl+v
ctrl+delete
ctrl+a
shift+delete
ctrl+l
shift+insert
ctrl+r
Comments
Post a Comment