Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Silver Contributor
Posts: 835
Registered: ‎03-24-2009
Accepted Solution

7.X LAN: any way to capture an ESC key and not close the form?

you enter a bad value on a form that fires off a calculation (Price * (1 - discount %) * Quantity = Amount or what have you) on the OnExit of the control.....

If you aren't in the control SLX/Windows closes up the form as a cancel.... any way to capture the ESC key and not close the form down?

RJ Samp
Bronze Super Contributor
Posts: 153
Registered: ‎04-08-2009

Re: 7.X LAN: any way to capture an ESC key and not close the form?

Unless there's an OnEsc event I don't know about, I don't think so.   If it is a modal form, I would think that Esc would be like a cancel click and the bad value would not be saved.   If you're worried about bad values in an Main View, I'd put validation in the WhenExit event.
Silver Contributor
Posts: 764
Registered: ‎04-17-2009

Re: 7.X LAN: any way to capture an ESC key and not close the form?

You can prevent the form from closing in AXFormCloseQuery - this works with Escape too, though tying it with the validation piece may be a bit tricky (I am not sure it will tell you which control has focus)
Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Re: 7.X LAN: any way to capture an ESC key and not close the form?

I told him that ;-)
--
RJ Ledger - rjledger@rjlSystems.net +1 603.369.3047 x101

".. Innovators in Mobility - Experts in Workflow Automation..."
http://www.rjlSystems.net - blog: www.rjlSystems.net/blog.html
Silver Contributor
Posts: 835
Registered: ‎03-24-2009

Re: 7.X LAN: any way to capture an ESC key and not close the form?

Raul gave me the answer...add an invisible button, make it the DEFAULT button. Make all other buttons Not Default.

When the user clicks on ESC, Enter, etc. then SLX goes to the default button.....handle the actions from there.....

RJ Samp
Copper Contributor
Posts: 94
Registered: ‎04-15-2009

Re: 7.X LAN: any way to capture an ESC key and not close the form?

Hi RJ,

 

Nice Trick. Thanks for sharing.

 

Thanks and regards

Sandeep Gaykhe

Thanks and Regards
Sandeep Gaykhe
Providian Global Solutions
Bronze Super Contributor
Posts: 129
Registered: ‎06-09-2009

Re: 7.X LAN: any way to capture an ESC key and not close the form?

Well, I am now here to claim my kudos points.... Smiley Wink
Raul A. Chavez
http://raul.chavez.com
http://www.crmbi.com