>In VFP6, I have been trying to determine what the active control in a form is and have had no luck at all!
>
>I have checked the latest MSDN as well as, the Nov 1998 Tech Net which labels this as a problem dating back to VFP 3.0.
>
>According to the syntax below, I should be able to determine which object has focus:
>
>THISFORM.ActiveControl.Name
>
>Has anyone ever had to deal with this? If so, is there a way to work around this MS feature?
>
>Thank you
It's supposed to work within a form, but will not work outside a form. So, generic way to handle this is to have Form.LastActiveControl property, and all form controls (subclass) may have Thisform.LastactiveControl=This in their GotFocus event. Also, you should add This.LastactiveControl=.NULL. to Form.Destroy event.
Edward Pikman
Independent Consultant