I have a Windows form named Form1 and panel within this form named panel1. I use the panel only to place buttons there so that I can group them and
Form1
panel1
You need to cast sender to the Button class so you can access its properties:
sender
Button
Button b = (Button)sender; MessageBox.Show(b.Text);