function TForm1.HaveSigned(MaxWaitTime: Cardinal): Boolean; var I:Integer; var WaitedTime:Cardinal; begin WaitedTime:=0; while (WaitedTime<MaxWaitTime) do begin SleepEx(100,False); Inc(WaitedTime,100); //状态栏变成兰色 Application.ProcessMessages ; endend;
MaxWaitTime 这个时间是什么格式啊 5秒是多少5000?
procedure TForm1.tmr1Timer(Sender: TObject); begin if (Time+20)>Time then stat1.Panels[0].Text:=''; stat1.Color:=RGB(222,222,222); end;procedure TForm1.btn1Click(Sender: TObject); begin stat1.Panels[0].Text:='添加成功'; stat1.Color:=RGB(101,101,101); end; 用一个TRTIME控件就可以搞定了!还是谢谢这位高手! 不过不知道怎么回事,点了按钮后,提示信息和颜色都边了,但时间好象很短,没过20秒就没了!
var I:Integer;
var WaitedTime:Cardinal;
begin
WaitedTime:=0;
while (WaitedTime<MaxWaitTime) do
begin
SleepEx(100,False);
Inc(WaitedTime,100);
//状态栏变成兰色
Application.ProcessMessages ;
endend;
5秒是多少5000?
begin
if (Time+20)>Time then
stat1.Panels[0].Text:='';
stat1.Color:=RGB(222,222,222);
end;procedure TForm1.btn1Click(Sender: TObject);
begin
stat1.Panels[0].Text:='添加成功';
stat1.Color:=RGB(101,101,101);
end;
用一个TRTIME控件就可以搞定了!还是谢谢这位高手!
不过不知道怎么回事,点了按钮后,提示信息和颜色都边了,但时间好象很短,没过20秒就没了!