April 20, 2024, 03:54:32 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Closing a dialog with the Esc key

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

Previous topic - Next topic

0 Members and 2 Guests 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