Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I tell what object on a form has the current focus
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00288577
Message ID:
00288696
Views:
25
>Is there something to tell me what object currently has the focus? We are currently setting a flag with gotfocus and lostfocus but it seems to be that there must be something in VFP itself to tell me.
CHEAP TRICK 33
public ThisControlHasFocus

in the controls Gotfocus:
ThisControlHasFocus=this.name

in the control's Lostfocus:
ThisControlHasFocus=[None]

Of course, if your triggering off another control with this method and the trigger has this implemented, then ThisControlHasFocus will be the trigger!

Like ed says, and it took me a few hours to learn, the concern is where the user is, so ..

Use control validations (valid,lostfocus,interactivechange) to assure that all the ducks are in a row, then allow with (enable and when) to push the process forward!

TT
Imagination is more important than knowledge
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform