To get rid of the Context Menu of a TextBox, and disable all short-cuts: set the 'ShortcutsEnabled property of the TextBox to 'false.
Or, you can disable the entire context-menu for a TextBox by assigning an "empty" ContextMenu to the TextBox 'ContextMenu property:
private void YourMainForm_Load(object sender, EventArgs e)
{
textBox1.ContextMenu = new ContextMenu();
}
If you need a custom Context Menu, you can, of course, add a ContextMenu to your Project and set it to be the ContextMenu of the TextBox.
Here's one way you could block keyboard paste; handling Shift/Insert is left for you to code:
private bool isControlKeyDown = false;
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if (ModifierKeys == Keys.Control) isControlKeyDown = true;
if (isControlKeyDown && e.KeyCode == Keys.V)
{
e.SuppressKeyPress = true;
}
}
private void textBox1_KeyUp(object sender, KeyEventArgs e)
{
isControlKeyDown = ModifierKeys == Keys.Control;
}