Highlight a series of control arrays

I have created a control array consisting of a series of labels.
When I move the mouse over each label, I want the label to grow in size.
In other words the label's font must grow in size when the cursor moves over.
I tried to pin point the cursor but it doesn't work for each individual label.
please help!!

I used the following code:

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim z
CurrentX = X
CurrentY = Y
Text1.Text = X
Text2.Text = Y
CurrentX = X > 595 And X < 795
If z < 695 And Y < 480 Then
        Label1(index).FontSize = 30
    Else
        Label1(index).FontSize = 20
    End If
End Sub
LVL 6
esolveSoftware Development ManagerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tureCommented:
esolve,

Try something like this:

Dim boldctl As Control

Private Sub Label1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  Set boldctl = Label1(Index)
  boldctl.FontBold = True
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  If Not boldctl Is Nothing Then
    boldctl.FontBold = False
    Set boldctl = Nothing
  End If
End Sub

Ture Magnusson
Karlstad, Sweden
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mcriderCommented:
Try this example... If you use it, reject the current answer:

Add 3 indexed labels to a new form.

Add the following to the form and run the program... Move the mouse over the labels...


Cheers!

The Code:


Private Sub Form_Load()
    Label1(0).Tag = "0"
End Sub
Private Sub Label1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Fix(Label1(Index).FontSize) > 8 Then Exit Sub
    Label1(CInt(Label1(0).Tag)).FontSize = 8
    Label1(0).Tag = CStr(Index)
    Label1(Index).FontSize = 14
End Sub


0
esolveSoftware Development ManagerAuthor Commented:
Thanks Ture - this will do just fine!!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.