How to remove the default context menu of a TextBox
Control?
Is there a propert
You can also set the ShortcutsEnabled
property to false
. This removes the default context menu and all clipboard functionality. I presume that's why you're trying to suppress the menu? I can't think of any good reason other than purposefully preventing your users from using copy/paste.
This works:
public partial class Form1 : Form
{
ContextMenu blah = new ContextMenu();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
textBox1.ContextMenu = blah;
}
}
Try setting the ContextMenu property of the TextBox to a dummy, empty ContextMenu instance.