Consultor Eletrônico



Kbase P176278: Application terminates when pressing Esc in a .NET dialog
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/28/2010
Status: Unverified

SYMPTOM(s):

Application terminates when pressing Esc in a .NET dialog

Application terminates when pressing Esc in an ABL .NET form

Code subscribes to the KeyDown event on the form

ESCAPE is trapped and APPLY to the focused widget on an ABL window

Application is blocked in ShowDialog with a .NET WAIT-FOR when ESCAPE is trapped and applied

FACT(s) (Environment):

OpenEdge Category: Language (4GL/ABL)
OpenEdge 10.2A
OpenEdge 10.2B
Windows

CAUSE:

Bug# OE00201225

CAUSE:

When applying the ESCAPE key, the AVM treats it as ENDKEY and at the end of the trigger executing (in this case, the event handler for the KeyDown event), AVM will handle the ENDKEY and cause the .NET application to exit as part of the ENDKEY processing, causing the whole application to close.

FIX:

Option #1
ESCAPE key could be handled in a manner similar to the following:

DEF VAR Current-form AS Progress.Windows.Form NO-UNDO .
Current-form = CAST (active-form, "Progress.Windows.Form").

/* if only want to handle dialogs, could do this */
IF Current-form:modal THEN
Current-form:DialogResult = System.Windows.Forms.DialogResult:Cancel.
/* or simply close the form */

Option #2
Use an ON END-ERROR trigger and ensure that it contains RETURN NO-APPLY.