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
private void HandleClick(object sender, EventArgs e) { var btn = sender as Button; if (btn != null) { MessageBox.Show(btn.Text); } }