procedure TForm1.Button1Click(Sender: TObject);
var
OldTime:integer;
begin
OldTime:=GetTickCount;
Button1.Enabled:=false;
//延时十秒
while(GetTickCount-OldTime<10000) do
//消息循环
Application.ProcessMessages;
Button1.Enabled:=true;
end;
var
OldTime:integer;
begin
OldTime:=GetTickCount;
Button1.Enabled:=false;
//延时十秒
while(GetTickCount-OldTime<10000) do
//消息循环
Application.ProcessMessages;
Button1.Enabled:=true;
end;
解决方案 »
- 圆内排列随机个正方形
- 在Image上DrawText任意格式的字???
- 请教如何操作多个checklistbox
- 散20分
- 各位大哥帮我看看这个问题,出错在哪?在线等...........
- 我想杷MSCOMM控件封装在DLL中,一些疑惑!!!!!!!!!!!!!!!!!
- 请问delphi7.0中有没有一个框架的控件或者那有第三方的控件,谢谢!
- 第一次打包,请教!
- delphi Indy10 udp怎么向外网发数据
- 请教F1book在制作安装盘的时候如何注册!
- 请问:如何在不打开一个.txt文件的情况下,将其内容全部复制到剪贴板上。(不限制文本文件大小)
- 问一下高手们,你家的机子什么配置啊?别说有 p166啊!呵呵呵
用timer1.enabled:=true;
and
timer1.enabled:=false;
来解决
FirstTickCount:longint;beginFirstTickCount:=GetTickCount;
repeat
Application.ProcessMessages;
until ((GetTickCount-FirstTickCount) >= Longint(msecs));end;
来自:http://www.inprise.com.cn/support/delphi/delay.htm
用法:sleep(time),time:integer;sleep(1000)表示延时1秒