>>>Hi,
>>>
>>>Programmatically, if I am in a method of a textbox, is there anyway I can determine whether the textbox itself is currently the active control which has focus?
>>>
>>>tslim
>>
>>Have you tried testing thisform.ActiveControl.name ?
>
>Not enough. It could be a control in one of many containers of the same class, and a member in each of these containers would have the same .name. We'd have form.container1.textbox1, form.container2.textbox1 again etc. Instead, compobj(thisform.activecontrol, this) would do it.
>
>Though it's possible that nothing has control at the time, i.e. thisform.activecontrol may be null, so some checking needs to be done.
What if I add a property say lHasFocus, then set its value each time when the event GotFocus and LostFocus are triggered...
will I still miss anything?
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only