Detecting focus target

  • Thread starter Thread starter Atlas
  • Start date Start date
A

Atlas

Is there an easy way to detect where the focus will be? Say in a textbox or
in form's lostfocus event...
That would help to understand better where the user is tryng to go, and
allow or not depending on the target object.........
 
You can look at the TabIndex of the current control, add 1 to that (unless you
are on the last control) and the next control to get focus will be the control
with that TabIndex.
 
Atlas said:
Is there an easy way to detect where the focus will be? Say in a
textbox or in form's lostfocus event...
That would help to understand better where the user is tryng to go,
and allow or not depending on the target object.........

Not readily. You can know which is the next or previous control in the
tab order, but you can't know whether the user has used a pointing
device to move to a control out of sequence.
 
Not readily. You can know which is the next or previous control in the
tab order, but you can't know whether the user has used a pointing
device to move to a control out of sequence.

Exactly!! If you could only know where you're going you could easily decide
if it is allowed or not...
 
Back
Top