PDA

View Full Version : Screen closing when pressing Enter key


tigran
04-24-2008, 01:42 PM
I can't figure out how to prevent my Screen from closing when Enter key is pressed. I have a couple of buttons on my screen (in addition to navication buttons), and even if one of them has a focus (which guarantees that next / close buttons are not in focus), the screen is still closing when Enter key is pressed.

How can I prevent this? Is there any way to trap and process OnKey event in the screen? Any help in this matter will be greatly appreciated!

Adam
04-24-2008, 02:15 PM
There is no way to capture the keystrokes in a screen. One potential workaround could be disabling the button when the screen starts:

DlgButton.SetProperties(CTRL_BUTTON_NEXT, {Enabled=false});

Then enabling it when you want to allow it to be pressed:

DlgButton.SetProperties(CTRL_BUTTON_NEXT, {Enabled=true});

Might require a little scripting to get working properly

Adam Kapilik