last pressed button name

  • Thread starter Thread starter fixertool
  • Start date Start date
F

fixertool

Let's say I have this:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
' some code here
End Sub

I need the name of the button (here is "Button1") in a string
variable, when I click this button.
But I couldn't find the way.
Any idea?
Thanks in advance
 
Let's say I have this:

Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click

Dim b As Button = DirectCast(sender, Button)
MessageBox.Show(b.Name)

End Sub
 
Back
Top