VB.NET What is Sender used for?

Viewed 39151

I'm confused as to the purpose of the sender parameter in Winform controls, for example:

Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

End Sub

I understand i can verify what sender holds by doing something as so:

If TypeOf sender Is Label Then
 'Execute some code...
End If

But is there a good reason that sender is included in every single control when it generates the sub-routine for me? In other words, i double click on a Form and i get the Private Sub form_load (sender....) and e As System.EventArgs.

What are some common usage of these two parameters? Are they always required?

Thank you,

Dayan D.

3 Answers
Related