Tuesday, September 11, 2018

Set the color of a label in a WinForms app.

if (alert.IsError)
{
   this.message.ForeColor = Color.Red;
}
else
{
   this.message.ForeColor = Color.Green;
}

 
 

By the way, there is also a BackColor setting for the labels too. Cool stuff.

No comments:

Post a Comment