Bart Moons3 reputationPosted Feb 9, 2011, 1:25 AM EST
0
What I want is that my character moves up, when I press the Up-arrow.
But it doesn't.
When I put a Messagebox.Show in my method, it doesn't show up.
My teacher didn't find the fault. Maybe I have to change something more?
0
FroglegRank #1,020 · 1.9K reputationPosted Feb 9, 2011, 3:14 AM EST
0
See if this works - make sure keypreview = true (just above language in properties window)
private void StartForm_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Down)
{
Messagebox.Show("Key down");
}
}
FroglegRank #1,020 · 1.9K reputationPosted Feb 8, 2011, 10:15 AM EST
Sam HobbsRank #107 · 20.5K reputationPosted Feb 8, 2011, 12:17 PM EST
Bart Moons3 reputationPosted Feb 9, 2011, 1:25 AM EST
FroglegRank #1,020 · 1.9K reputationPosted Feb 9, 2011, 3:14 AM EST
private void StartForm_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Down)
{
Messagebox.Show("Key down");
}
}