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:
00289114
Views:
24
>CHEAP TRICK 33
>public ThisControlHasFocus
>
>in the controls Gotfocus:
>ThisControlHasFocus=this.name
>
>in the control's Lostfocus:
>ThisControlHasFocus=[None]

Using public variables in forms is generally a Bad Thing. What if you run this form twice?

If you have to use this technique, instead of ThisForm.ActiveControl, it's much better to create a custom form property (Form menu: New Property). That way, it's scoped to the form. Mike Helland explains above what else is wrong with this technique...
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Previous
Reply
Map
View

Click here to load this message in the networking platform