Consultor Eletrônico



Kbase P143407: How to leave focus on UltraMaskedEdit control by pressing the arrow-down key
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   01/04/2009
Status: Unverified

GOAL:

How to leave focus on UltraMaskedEdit control by pressing the arrow-down key

FACT(s) (Environment):

Windows
OpenEdge 10.2x

FIX:

If the UltraMaskedEdit control is set to use Time format, then its default behavior is that on arrow-down key press changes hour, minute, or pm/am value.
In order to change this default behavior and force focus leave on arrow-down key, follow the steps:

- Place the UltraMaskedEdit control on the form
- Add the code for KeyDown event
- Put the following code in that event method:
METHOD PRIVATE VOID ultraMaskedEdit1_KeyDown( INPUT sender AS System.Object, INPUT e AS System.Windows.Forms.KeyEventArgs ):
IF e:KeyValue = 40 THEN ultraCombo1:Focus() .
IF e:KeyValue = 40 THEN e:SuppressKeyPress = TRUE .
RETURN .
END METHOD.
Value 40 here represents the arrow-down key and ultraCombo1
represent the next control where the focus should be applied.