protected void ControlFlashing(Object sender, EventArgs events) { if (redlight.getIsFlashing()) { flashingclock.Stop(); startandstopbutton.Text = "Resume"; startandstopbutton.BackColor = Color.Green; } else { flashingclock.Start(); startandstopbutton.Text = "Pause"; startandstopbutton.BackColor = Color.Red; } redlight.toggleIsFlashing(); Invalidate(); }