DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Toggle Text On Button (Using Thread Timers)
// Works on a seperate thread and changes the color of a button if a significant event happens
void HotShotTick(object obj)
{
if (this.InvokeRequired) { this.Invoke((MethodInvoker)delegate {
this.FillHotshots();
if (this.dsSignificant.HotshotBets.Rows.Count > 0)
{
this.btnHotShotBets.BackColor = Color.Red;
}
else
{
this.btnHotShotBets.BackColor = Color.Green;
}
});
}




