C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » Graphics »

Show your Label in different color in Runtime C#


Posted Date: 06 Aug 2009    Resource Type: Code Snippets    Category: Graphics
Author: Ramesh N DMember Level: Gold    
Rating: 1 out of 5Points: 5



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;
}
}



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Show your Label in different color in Runtime C#  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Draw the rectangle around the text
Previous Resource: Rotate the string
Return to Discussion Resource Index
Post New Resource
Category: Graphics


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use