1.  添加Timer控件

VS VB.NET Timer控件

2. 设置Timer控件的属性:

VS VB.NET Timer控件

3. 添加控件触发时执行的代码:

   实现的功能为:每1000ms在Label1上显示一遍当前时间。

 Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

        Label1.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
    End Sub

4. 执行效果如下:

每秒钟变化一次。调整一下Timer控件的属性-Interval 试一下吧!

VS VB.NET Timer控件

 

 

相关文章:

  • 2021-12-12
  • 2022-12-23
  • 2021-06-28
  • 2021-06-01
  • 2021-10-28
  • 2022-01-11
  • 2022-02-02
猜你喜欢
  • 2022-12-23
  • 2021-12-15
  • 2021-07-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案