waytech2003
Programmer
I have 14 Frames on a Form that each contain about 20 Labels. All labels are of a single array Label1(xxx). This can not change because the Lables captions are filled from a database when Form is loaded.
I would like to change the background color of the Labels when I mouseover given Frame.
How can I find only the Labels in the desired Frame?
I currently am using the code below, but that looks at all the controls on the Form and I would like it to be quicker.
I would like to change the background color of the Labels when I mouseover given Frame.
How can I find only the Labels in the desired Frame?
I currently am using the code below, but that looks at all the controls on the Form and I would like it to be quicker.
Code:
Dim xCount As Integer
Dim m_Selected As Integer
Dim CTL As Control
Dim WorkingFrame As Frame
Set WorkingFrame = Frame1(m_Selected)
For Each CTL In Me.Controls
If TypeOf CTL Is Label Then
If CTL.Container = WorkingFrame Then CTL.BackColor = vbGreen
End If
Next