public static void Delays(int DelayTime = 100)
        {
            int time = Environment.TickCount;
            while (true)
            {
                if (Environment.TickCount - time >= DelayTime)
                {
                    break;
                }
                Application.DoEvents();
                Thread.Sleep(10);
            }
        }
 
        public static void Delay1(int milliSecond)
        {
            int start = Environment.TickCount;
            while (Math.Abs(Environment.TickCount - start) < milliSecond)
            {
                Application.DoEvents();
            }
        }
 
        //延时程序 秒
        public static bool Delay2(int delayTime)
        {
            DateTime now = DateTime.Now;
            int s;
            do
            {
                TimeSpan spand = DateTime.Now - now;
                s = spand.Seconds;
                Application.DoEvents();
            }
            while (s < delayTime);
            return true;
        }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-05
  • 2022-12-23
  • 2021-11-17
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-07
  • 2021-11-26
  • 2021-08-31
  • 2022-02-28
  • 2021-11-16
  • 2022-12-23
相关资源
相似解决方案