如何用VB做计时器,要有时分秒?

来源:百度知道 编辑:UC知道 时间:2024/05/09 20:28:16

用一个Timer1控件不就行了??

mHour=hour(now)
mMinute=minute(now)
mSecond=second(now)

画三个text
一个cammand
一个timer1

dim i as integer
dim j as integer
dim k as integer
private sub timer1
timer1.interval=1000
i=i+1
if i=60 then
j =j+1
i=0
end if
if j=60 then
k=k+1
j=0
end if
text1.text=i
text2.text=j
text3.text=k
end sub