` Printed Icetips Article

Icetips Article



Par2: Trapping Esc key and preventing window exit
1999-11-07 -- Steve Parker
 
In a window template procedure:

Alert the EscKey (you will have to manually type its name in).

Then, in  Window Event Handling for the Alert key:

 If KeyCode() = EscKey
   Message('You must select a pricing action.','Warning',Icon:Hand)
   Select(1)
   Cycle
   Return Level:Notify
 End

will prevent the user from closing the window on the Esc key.



Printed November 23, 2024, 10:20 pm
This article has been viewed/printed 35207 times.