如何在VB中放timer定时器

如题所述

第1个回答  2019-05-12
放一个timer控件,interval属性设置为1000,表示每秒执行一次TIMER中的代码
代码如下:
label1.caption
=
time
‘这样就能每秒都更新系统时间并显示在label1这个标签上,
这个time是返回当前系统时间的函数!
第2个回答  2019-11-21
Private
Sub
Form_Load()
Timer1.Interval
=
1000
End
Sub
Private
Sub
Timer1_Timer()
Text1.Text
=
Time
End
Sub
你要创建一个时钟控件,就上面这几行代码就行了