OWL NExt - Knowledge Base

[ Home | Contents | Search | Next | Previous | Up ]

Keeping dialog open when enter is pressed

Date: 2/4/00
Time: 7:16:39 PM
Remote Name: 127.0.0.1

Comments

As Ian Spencer wrote in his book: Teach yourself OWL in 21 days...

" If you want to disable the Enter key in a Dialog, you can use the "LeBlanc Maneuver". Rather than creating a button with an indentifier of IDOK, set the default button to the value IDOK with SetDefaultId in SetupWindow(). You will find that, even though the button does not exist, the dialog will act as if the OK button has been pressed when you press the Enter key. All that remains is to define an EV_BN_CLICKED response function that does nothing in place of the OWL default processing, and you dialog will no longer accept Enter as a valid key. This works because the Enter processing does not actually press the button; it requests the control to flicker and send the control notification itself. "

hope this helps..

Rejean

Last changed: July 14, 2001