Show your Label in different color in Runtime C#

Description :


This code shows your label in different color in runtime.. it is C# code...


//timer interval = 1000
public int flag = 0;
private void timer1_Tick(object sender, EventArgs e)
{
switch (flag)
{
case 0:
label1.ForeColor = Color.Red;
flag = 1;
break;
case 1:
label1.ForeColor = Color.PowderBlue;
flag = 2;
break;
case 2:
label1.ForeColor = Color.RosyBrown;
flag = 3;
break;
case 3:
label1.ForeColor = Color.Black;
flag = 4;
break;
case 4:
label1.ForeColor = Color.PaleGreen;
flag = 0;
break;
}
}


Comments

Author: Suresh09 Sep 2011 Member Level: Gold   Points : 1

Hi Ramesh,

It is good article about Show your Label in different color in Runtime C#. it is useful for me.

Thanks
S.Suresh



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: