Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OnKeyPress and paste
Message
General information
Forum:
ASP.NET
Category:
Forms
Title:
OnKeyPress and paste
Miscellaneous
Thread ID:
00992739
Message ID:
00992739
Views:
88
Does Ctrl+V count as one keypress or two keypresses?
Considder the following code that I have in my OnKeyPress
protected override void OnKeyPress(System.Windows.Forms.KeyPressEventArgs e)
{
	switch(e.KeyChar)
	{
		case '\b':
		case '0':
		case '1':
		case '2':
		case '3':
		case '4':
		case '5':
		case '6':
		case '7':
		case '8':
		case '9':
		{
			e.Handled = false;
		}break;
//		case System.Windows.Forms.Keys.ControlKey + System.Windows.Forms.Keys.V:
//		{
//			System.Windows.Forms.MessageBox.Show("ctrl+v");
//                         e.Handled = false;
//		}break;
		default:
		{
			e.Handled = true;
		}break;
	}
}
I have commented out some of the code above, because it doesn't compile. Any hints regarding how I can allow paste would be appreciated.

Thanks,
Einar
Semper ubi sub ubi.
Next
Reply
Map
View

Click here to load this message in the networking platform