View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
John T Ingato John T Ingato is offline
external usenet poster
 
Posts: 23
Default test if a control has or doesnt have focus?

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