时钟组件怎么用?
时钟组件怎么用? --------------------编程问答-------------------- 你问的哪个组件啊?是datetimepicker,还是timer组件? --------------------编程问答-------------------- 参考 --------------------编程问答----------------------------------------编程问答--------------------
Dim tm As New Timer
tm.Start()
'或者直接拖个时钟控件
Public Class Form1--------------------编程问答-------------------- Dim timer1 As Timer
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Static i As Long
i = i + 1
TextBox1.Text = i & "秒"
If i = 300 Then
Timer1.Stop()
MsgBox("5分钟")
End If
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Timer1.Interval = 1000
Timer1.Start()
End Sub
End Class
Me.timer1.Interval = 1000
AddHandler Me.timer1.Tick, AddressOf Me.timer1_Tick
Private Sub timer1_Tick(ByVal sender As Object, ByVal e As EventArgs)
timebox.Text = DateTime.Now.ToString()
End Sub
补充:.NET技术 , VB.NET