|
|
导航: |
论坛 -> DELPHI技术
斑竹:liumazi,sephil |
|
作者: |
|
2003/6/4 21:28:53 |
标题: |
|
加入我的收藏 |
楼主: |
我想在form中,显示一个时间的倒计时.谢谢帮忙!
----------------------------------------------
- |
作者: |
|
2003/6/4 23:00:34 |
1楼: |
放个timer,比如每秒倒计时一次,则设置1000毫秒执行ontimer事件一次: 假设用lable1显示这个倒计时,从30秒开始倒计时。 procedure form1.formshow(***); begin label1.caption:='30'; end;
procedure timer1.ontimer(***); begin if lable1.caption<>0 then label1.caption:=inttostr(strtoint(label1.caption)) else lable1.caption:='倒计时结束'; end;
如果你想让lable1显示一些别的,也可以用一个变量
----------------------------------------------
-
|
|