which control in collection has focus?

mickn66

Regular
Joined
Nov 2, 2002
Messages
53
How can I tell which control in a collection of controls (actually on on a panel) has the focus - or which control the mouse is hovering over, or which control in the collection was just clicked?

Any help would be greatly appreciated! Thanks!

Mick
 
Check the Control.Focused property.
Visual Basic:
Dim c As Control

For Each c In someControl.Controls
     If c.Focused Then
          MessageBox(c.ToString, Application.ProductName)
     End If
Next
That code is off the top of my head, so if it doesn't work just give a yell.
 
Back
Top