lol双11:vb中如何才能得到系统的时间?
来源:百度文库 编辑:高校问答 时间:2024/10/03 17:38:49
用Timer时钟控件,将它的属性interval设置为500
Private Sub Timer1_Timer()
If Label1.Caption <> CStr(Time$) Then
Label1.Caption = Date$
Label2.Caption = Time$
End If
End Sub
用now就行了
text1.text=now
就能在text里面显示出当前的时间
建两个label,form_load中输入
Label1.Caption="日期是:" & Date()
Label2.Caption="时间是:" & Time()