Trap on Ctrl+C, Ctrl+V and Ctrl+X in TextBox KeyPress Event

Trap on Ctrl+C, Ctrl+V and Ctrl+X in TextBox KeyPress Event

Added by Sixth Sense updated on Wednesday, March 28, 2018

Trap on Ctrl+C, Ctrl+V and Ctrl+X in TextBox KeyPress Event:

In this small snippet we will cover how to trap on Ctrl+C, Ctrl+V and Ctrl+X in TextBox KeyPress Event.

protected override void OnKeyPress(KeyPressEventArgs e)
{
	switch(e.KeyChar)
	{
		case (Char)3:
			//Handle Ctrl + C
			break;
		case (Char)22:
			//Handle Ctrl + V
			break;
		case (Char)24:
			//Handle Ctrl + X
			break;
	}
}
				

Related Tags

About

29 Tutorials
25 Snippets
6 Products

More

Contact Us

Contact us

Stay Connected