Hi,
I have two control on form1
How to check control1 got focus or not from an sub or procedure ?
Printable View
Hi,
I have two control on form1
How to check control1 got focus or not from an sub or procedure ?
write a MsgBox in your control's GotFocus Event and that code will get executed once that control got focus. or in a form you can check with this codethis will give you current control's nameVB Code:
Me.ActiveControl.Name
thanks
Try it, it work.
But there is other method then this? (Me.ActiveControl.Name)
I use only these codes...Im not sure is there any other methods
why would you need another method?
coz, i want to make it generic, i don't want to compare it to each control i have
Quote:
Originally Posted by barianto
It wont........ I will return the current active Control (name). Perfect for your Sub()!
Ok then. This is resolved :)