how to send button name for method in c#

71

how to send button name for method in c# -

void button_Click(Object sender,  EventArgs e)
{
    var button = sender as Button;
    if(button != null)
    {
        button.Text = "X";
        button.ForeColor = System.Drawing.Color.Red;
    }

}

Comments

Submit
0 Comments