Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Toggle Text On Button (Using Thread Timers)

DZone's Guide to

Toggle Text On Button (Using Thread Timers)

·
Free Resource
// 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;
}
});
}

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}