本文整理自网络,侵删。
Procedure TForm1.Delay(Msecs: Integer);
var FirstTickCount: real;
begin
FirstTickCount:= GetTickCount;
Repeat
Application.ProcessMessages;
Until ((GetTickCount - FirstTickCount) >= LongInt (Msecs));
end;
程序调用:Delay(500);
在DelphiXE10.1中直接使用没问题。
相关阅读 >>
更多相关阅读请进入《Delphi》频道 >>