sender contains the event sender, so if you have one method associated with several controls, you can distinguish between them.
For example, if you had ten buttons and you wanted to change your text to “You clicked me!” when you clicked on one of them, you could use one separate handler for each of them, each time using a different button name, but it would be better to process everything at once:
Private Sub Button_Click(sender As Object, e As EventArgs) Handles Button1.Click, Button2.Click, Button3.Click, Button4.Click, Button5.Click, Button6.Click, Button7.Click, Button8.Click, Button9.Click DirectCast(sender, Button).Text = "You clicked me!" End Sub
source share