/// <summary> /// Sets mode count and colors it, if its count is over the limit. /// </summary> /// <param name="modeCounter">Label of the label associated with the mode.</param> /// <param name="count">New count.</param> /// <param name="isOverLimit">Bool to specify, if limit is reached.</param> public void SetModeCounter(Label modeCounter, int count, bool isOverLimit) { if (modeCounter.InvokeRequired) { SetModeCounterSafely d = new SetModeCounterSafely(SetModeCounter); Invoke(d, new object[] { modeCounter, count, isOverLimit }); } else { modeCounter.Text = count.ToString(); if (isOverLimit) { modeCounter.BackColor = Color.PaleGreen; } else { modeCounter.BackColor = SystemColors.Control; } } }