W
weixiulu
Unregistered / Unconfirmed
GUEST, unregistred user!
先点击Button1,2、3秒后点击Button2,但是两个按钮的标题同时改变,想让他按照自己的延时显示标题。请各位指教。
procedure TimeDelay(DT: DWORD);
var
TT : DWORD;
begin
TT := GetTickCount();
while GetTickCount()-TT<DTdo
begin
Sleep(10);
Application.ProcessMessages;
//
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
button1.Caption:='0';
timedelay(5000);
button1.Caption:='1';
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
button2.Caption:='0';
timedelay(10000);
button2.Caption:='2';
end;
procedure TimeDelay(DT: DWORD);
var
TT : DWORD;
begin
TT := GetTickCount();
while GetTickCount()-TT<DTdo
begin
Sleep(10);
Application.ProcessMessages;
//
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
button1.Caption:='0';
timedelay(5000);
button1.Caption:='1';
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
button2.Caption:='0';
timedelay(10000);
button2.Caption:='2';
end;