Escape character ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I'm developing an application that will run on PPC and on WinCE devices.

For this last situation I would like to close the current dialog box if the
user press the ESC button, but the KeyPress, KeyDown, KeyUp events are not
called when I press this button.

Why ? How can I solve this problem ?

Thank you in advance.

Keven Corazza
 
Did you include the KeyPreview = true in your form?

Include "this.KeyPreview = true;" or "Me.KeyPreview = True" in the in
constructor of your form or after the call to Initialize Component. (In
Visual Studio 2005 beta versions, you can add a Sub New to your form with
the code editor dropdowns).

Then you event handler ( such as Form1_KeyDown) should be able to trap the
ESC key. You only need to handle KeyDown.

- Bruce Hamilton
..NET Compact Framework User Education
 
It would be a good idea to include the referenced post (completely or
partially), so that it made more sense to those using OE and threaded view
 
Back
Top