Arrow key does not fire keyDown-event

A

anoehre_1

Hi!

Very simple Application:

-------------------------------
this.KeyDown += new
System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);

[...]

private void Form1_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e)
{
this.label1.Text=" --> "+ e.KeyData.ToString();
}
-----------------------------------

Every key on my keyboard works but the arrow keys (up,down, left,
right) doesnt.
Funny: When pressing "Strg" or "Alt" and Arrow Keys the Event is fired.

Any suggestions?

Arne
 
G

Guest

You need to catch the KeyUp event. this worked for me:

private void myTextBox_KeyUp(object sender,
System.Windows.Forms.KeyEventArgs e)
{
if (e.KeyData == Keys.Down )
{
//do something
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top