test if a control has or doesnt have focus?

J

John T Ingato

Is it possible for me to test if a control has or doesnt have focus?

Event handlers are called even when the associated event wasn't user
generated. for example, if a listbox is updated in another method


Sub listbox_click()

some code

End sub


Can I test to see if the user clicked or if another method called it by
testing for focus? For example:



Sub listbox_click()

if gotfocus(listbox) then some code

End sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top