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:
00288795
Views:
19
>>Best to check:
>>
>>
VARTYPE(<i>ObjRef</i>.activecontrol) = 'O' AND ! ISNULL(<i>ObjRef</i>.activecontrol)
>
>PMFJI, I put a single textbox on a form. put the following in the forms activate:
>
>thisform.text1.setfocus
>? vartype(thisform.activecontrol) = 'O'
>
>If the textbox is enabled I get .T.,
>if it's disabled I get an error 'thisform.activecontrol is not an abject'?
>
>I would think you would get .F. when disabled, what gives?

You may have to use TYPE("thisform.activecontrol") rather than VARTYPE(thisform.Activecontrol) - there's something funny that goes on with _screen.ActiveControl, and it may apply to thisform.activecontrol as well (it'd actually make sense if they behaved the same way.)
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform