I am trying to get the text value from a button that was clicked. In my head, it looks something like this:
private void button2_Click(object sender, EventArgs e)
{
string s = thisbutton.text
}
The object which fired the event is sender
, so:
private void button2_Click(object sender, EventArgs e)
{
string s = (sender as Button).Text;
}