I have n Labels on Form, e.g: Label1, Label2,..., Labeln. Normally, when I write Click event for all Labels:
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
Msgbox "1"
End Sub
Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label2.Click
Msgbox "2"
End Sub
Private Sub Labeln_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Labeln.Click
Msgbox "n"
End Sub
Writting is very complex when n is large!
Now, I want to write the code simply to click to Lablei and generate "i" (one proceduce to many proceduces). How to handle it? Thanks in advance.
Handles Label2.Click, Label3.Click, Labelx.Click, Labely.Click....
extend one of the click events to handle them all – Ňɏssa Pøngjǣrdenlarp