private void Delay( int Millisecond) //使用时直接调用即可 { DateTime current = DateTime.Now; while (current.AddMilliseconds(Millisecond) DateTime.Now) { Application.DoEvents(); // 转让控制权 } return ; }
private void Delay(int Millisecond) //使用时直接调用即可 { DateTime current = DateTime.Now; while (current.AddMilliseconds(Millisecond) > DateTime.Now) { Application.DoEvents();//转让控制权 } return; }