Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Has Focus
Message
From
06/11/2014 20:51:23
 
 
To
06/11/2014 16:10:47
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01610620
Message ID:
01610639
Views:
79
>>Hi All:
>>
>>I'm embarrassed to ask this question:
>>
>>1. How can I find out which object has focus?
>>2. Related to #1: How can I say something like this:
>>
>>
>>If thisform.txtBox1.hasfocus = .t.
>>    Do Box1Processing
>>endif
>>
>
>1. thisform.activecontrol - which may be null if none has focus (when clicked on a toolbar button, for instance, or form not active... there are situations like that).
>
>2. you'd need to create that property and assign it .t. in each object's .gotfocus() and .f. in .lostFocus() (which you may still do without polluting all your classes by using bindevent()).
>
>Is there any serious reason why you can't put "Do box1processing" in txtbox1.gotfocus()?

Thanks, Dragan. No, I can't think of a serious reason! I guess my example wasn't that useful!
Previous
Reply
Map
View

Click here to load this message in the networking platform