Wednesday, November 27, 2013

To set a couple events for all label in a form?

I want to use MouseEnter and MouseLeave events for Labels in a form as collectively.I have below but How I call event in For Next loop?



For Each ctl As Control In Me.Controls
If (ctl.Name.StartsWith("Label")) AndAlso (TypeOf ctl Is Label) Then
Dim lbl As Label = DirectCast(ctl, Label)
End If
Next ctl


No comments:

Post a Comment