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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -