当前位置: 代码迷 >> VFP >> 倒计时,该怎么处理
  详细解决方案

倒计时,该怎么处理

热度:4571   发布时间:2013-02-26 00:00:00.0
倒计时
想做一个倒计时60秒的时间条,随时间减少而变短,要美观点,我不会做,能给我点建议吗?谢谢

------解决方案--------------------------------------------------------
用计时器,TIMER,另外用一个形状、文本框、标签、容器等等等等,反正你能搞出一个方块的样子就行,背景色设成你喜欢的颜色。这个东东的宽度设置成60的倍数,N倍。

TIME的TIMER事件:
thisform.你的控件.width=thisform.你的控件.width-N
if thisform.你的控件.width=0
wait '时间到!' wind
endi
------解决方案--------------------------------------------------------
local oform 

oform=createobject("form") 
oform.addobject("close1","closecmd") 
oform.addobject("text1","textbox") 
oform.addobject("time11","time1",oform) 
oform.text1.value=60 
oform.controlbox=.F. 
oform.visible=.T. 
oform.text1.visible=.T. 
oform.close1.top=60 
oform.close1.visible=.T. 
read event 
oform.release 

DEFINE CLASS closecmd AS commandbutton 
top=40 
left=0 
height=24 
caption= "Close " 
Procedure click 

clear event 
EndProc 
ENDDEFINE 
DEFINE CLASS time1 AS timer 
top=0 
left=0 
interval=1000 
oform1= " " 
Procedure init 
parameters pof 

this.oform1=pof 
EndProc 
Procedure timer 

if this.oform1.text1.value> 0 
this.oform1.text1.value=this.oform1.text1.value-1 
else 
this.oform1.text1.value=60 
endif 
EndProc 
ENDDEFINE
  相关解决方案