If you are using ASP.NET button or Windows button then here is the code to change background color randomly.
protected void btnClick_Click(object sender, EventArgs e)
{
Random obj = new Random();
int r = obj.Next(255);
int g = obj.Next(255);
int b = obj.Next(255);
btnClick.BackColor = System.Drawing.Color.FromArgb(r,g,b);
}
i hope it helps.