What is the proper syntax to perform and if statement concerning a buttons color.
Sample code that is non-working:
if (this.btnChat1.BackColor="Color.Salmon")
{
this.btnChat1.BackColor = Color.DarkBlue;
}
else
{
this.btnChat1.BackColor = Color.Salmon;
}
C Sharp if statement concerning button color.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
David3 pointsPosted Mar 3, 2008, 11:06 AM EST
Fixed Code by utilizing == in an if statement instead of =.
DOH!
Ashish Sharma5 pointsPosted Mar 7, 2008, 7:37 AM EST