Handling KeyPress events in CF 2.0

Hi I have created a CF2.0 form with a picture box and running on a mobile device running WinCE 6.0 with USB keyboard connected.
I have to change the pictures in the "pictureBox" using keyboard keys. I have handled the "KeyPress" event for the form. But if I press any key on the keyboard, it is not generating any "event" in the form.

Any Ideas?
Thanks for your help.
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Form1_KeyPress);
//Event Handler
 private void Form1_KeyPress(object sender, KeyPressEventArgs e)

Open in new window

Who is Participating?
Mike TomlinsonConnect With a Mentor Middle School Assistant TeacherCommented:
Try setting the KeyPreview() Property of the Form to true:
All Courses

From novice to tech pro — start learning today.