key press and click (OpenInsight 32-Bit)
At 18 JUN 2004 12:04:34AM William Ng wrote:
Hello,
Does anyboby know how to detect if the user hit the enter key or click somewhere else to get out of an editline control?
At 18 JUN 2004 07:22PM Richard Hunt wrote:
If you were to use the following statement, you would get the next control in tab order. And the LOSTFOCUS event would give you the control that focus was lost to.
Given that you could assume that if they match then an ENTER key was pressed. If they do not match then a CLICK was performed.
This is not 100% accurate. It is possible to click to the next control in tab order. It is also possible to disable controls.
At 21 JUN 2004 09:07AM Bob Carten wrote:
William
In Windows it should not matter how the user gets to a prompt. If you want to prevent landing on field B until Field A has a valid value, try setting enabled value of B during the lostfocus of A.
You would also need to reset enabled on the read event.
In a more complex window you can route your lostfocus events through a 'commuter module', have a section that sets enabled and disabled values for one list of controls based on the values of another list of controls. In other words, instead of worrying about one control a t a time, you check the state of the whole window each time.
Finally, if you want to force the users to go through a window one piece at a time, look at the wizard wizard.
Bob