0

I'm creating a simple C# program that deals with pressing the DELETE key button in the keyboard. so what I created a key press event, but seems like the delete key doesn't work.. i tried it with other keys and it's working fine... why?? and is 46 the keycode for delete?

2
Contributors
1
Reply
3
Views
10 Years
Discussion Span
Last Post by Jx_Man
3

handle it with keydown event :

private void TextBox1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
	if (e.KeyCode == Keys.Delete)
	{
		MessageBox.Show("you pressed delete key");
	}
}
Votes + Comments
Good
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.