怎么在VB.net中实时显示时间

2025-04-09 01:04:08
推荐回答(1个)
回答1:

定时器中处理

  Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Interval = 10 '10毫秒刷新一次
        Timer1.Start() '开启定时器
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Label1.Text = Now
    End Sub