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 shortcutsenabled property 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

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -