I have an array of labels in VB2003. They are all black. When a user clicks on the label it should reset all labels to black and change the clicked one to red.
The code
Private Sub Label_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
For index = 0 To IPs
label(index).ForeColor = Color.Black
Next
label(GetIndex(sender)).ForeColor = Color.Red
End Sub
I use this on 2 seperate forms. On one, this sub seems to work half a dozen times and then stops working. On the other, it works once then stops.
Any ideas?
Thanks
The code
Private Sub Label_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
For index = 0 To IPs
label(index).ForeColor = Color.Black
Next
label(GetIndex(sender)).ForeColor = Color.Red
End Sub
I use this on 2 seperate forms. On one, this sub seems to work half a dozen times and then stops working. On the other, it works once then stops.
Any ideas?
Thanks