Link to home
Start Free TrialLog in
Avatar of Karl66
Karl66

asked on

C# VS2008 how to recognize a key was pressed?

C# VS2008 how to recognize a key was pressed?

Lets say I create a form with nothing on it. If somone presses F1 I want a message to pop up. I went into events and tried a key pressed and key down event like if (e.KeyCode == Keys.F1)
            {
                MessageBox.Show("Test");
            }
but when I press F1 nothing happens. Almost like the form isn't actively looking for the event?? Any thoughts!

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Karl66
Karl66

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bob Learned
I believe that is because F1 is the system help key.