void shakeLabel(Label lb) { if (lb.InvokeRequired) { SetShakeLabelCallback d = new SetShakeLabelCallback(shakeLabel); this.Invoke(d, new object[] { lb }); } else { lb.BackColor = Color.Red; Application.DoEvents(); System.Threading.Thread.Sleep(50); lb.BackColor = Color.White; Application.DoEvents(); } }
void shakeLabel(Label lb) { if (lb.InvokeRequired) { SetShakeLabelCallback d = new SetShakeLabelCallback(shakeLabel); this.Invoke(d, new object[] { lb }); } else { lb.BackColor = Color.Red; Application.DoEvents(); System.Threading.Thread.Sleep(50); lb.BackColor = Color.White; Application.DoEvents(); } }