VFP表单的题目!帮忙!吧!

来源:百度知道 编辑:UC知道 时间:2024/05/17 01:14:45
设计一个秒表功能的计时器表单,在文本框中可以输入一个初始值,单击开始按钮,开始计时;停止按钮,停止计时;当文本框值为0时,出现一个内容为BOM!的标签

你要什么格式啊?秒表一样的显示方式?

这里简单起见就简化了
form1 init事件下
public nadd
nadd=0
thisform.label1.visible=.f.
thisform.timer1.enabled=.f.
thisform.timer1.interval=1000
一秒刷新一次

command1 click 事件下 开始按钮
nadd=val(thisform.text1.value)
thisform.timer1.enabled=.t.
thisform.command1.enbaled=.f.
thisform.label1.visible=.f.

command1 click事件下 停止按钮
thisform.timer1.enabled=.f.
thisform.command1.enbaled=.t.

timer1 timer事件下
nadd=nadd-1
thisform.text1.value=alltrim(str(nadd))
thisform.refresh
if nadd=0
thisform.timer1.enabled=.f.
thisform.label1.visible=.t.
thisform.label1.caption="Bom!!!!!!!!"
endif

测试通过 timer1是timer控件