December 06, 2022, 10:05:27 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Closing a dialog with the Esc key

Started by Haim, November 03, 2006, 02:07:16 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Haim

Hi,
I guess I am the first to try this child board out   :)
Is there an automatic way to have a dialog close in response of the user hitting the Esc key? (similar to reacting to the Enter key as if the default button was clicked)

Haim

Ionic Wind Support Team

The OS reserves ID numbers of 1 and 2 for OK and CANCEL buttons.  When creating your dialog give the CANCEL button the ID of 2 and close the dialog in response to that button in your OnControl handler.

When you press the escape key the default dialog process checks to see if a button with an ID of 2 exists, and if so presses it.  It can also be a hidden button if you don't want it to be visible to the user, but still want ESC key functionality

Ionic Wind Support Team

Haim

So simple,
but I did not know it...   :-[

Thanks for showing me,

Haim