How can I refer to a control within its event? (without using it's name)
Is there a way in .net to refer to a control generically (so that if the control name changes, etc.) you don't have a problem.
I.e., the object level version of the "me" keyword.
So, I'd like to use something generic instead of RadioButton1 in the example below.
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged If RadioButton1.Checked Then Beep() End Sub
Lets see if I remember VB.NET:
Dim rb as RadioButton = sender If rb.Checked Then...
Yes, the "sender" parameter is the control that triggered the event.