vb时钟时间间隔这样设置:
添加两个命令按钮和一个计时器即可
private n as long
private sub command1_click()
timer1.interval = 10
timer1.enabled = true
end sub
private sub command2_click()
timer1.enabled = false
open "c:\1.txt" for output as #1
print #1, format(n / 100, "00.00")
close #1
print "时间保存在c:\1.txt"
end sub
private sub form_load()
end sub
private sub timer1_timer()
cls
n = n + 1
print "已用时间:" & format(n / 100, "00.00")
end sub
时间间隔设置有两种方法:
1、直接在timer控件的属性栏中找到interval,把interval的值改成想要的时间间隔。
2、在form窗体中双击鼠标,在form _load中写代码控制,timer1.interval=800 .