Hi James
While, I can do that there are instances where I also need to know up front before the control loses focus. I need a way to generically set a current control indicator and a previous control indicator.
I have discovered that if I put DODEFAULT() in the GotFocus event of the affected controls and use BINDEVENTS(myControl,'GotFocus',thisform,'CheckControl',1) the forms "ActiveControl" is a valid object.
I suspect/feel that this is an error in VFP or that the BindEvent needs another flag so that one could bind to the post event point.
Regards
Geoff Scott
>Geoff,
>
>The way I do it is to put code in the lostfocus event of my controls that stores the object in a form property call oLastfocus. Then I can evaluate oLastfocus when I need to.
>
>
>procedure lostfocus()
>thisform.oLastfocus = this
>endproc
>
>
>>Hi
>>
>>I am having problems with the ActiveControl property. I need to know which control had focus prior to a command button being clicked. I thought I would use BINDEVENTS to bind the GotFocus event of all the controls and then use the form's ActiveControl property to determine what control had focus.
>>
>>Unfortunately, I always end up with Thisform.ActiveControl not evaluating to an object,
>>
>>Why is this and how can I determine which control has focus?
>>
>>Regards
>>Geoff Scott
May all your weeds be wildflowers