蚂蚁和蜈蚣的笑话:VB高手进!!!!!!!!

来源:百度文库 编辑:高校问答 时间:2024/04/28 21:35:19
让时间跟系统时间一致的代码咋写

Option Explicit
Private Sub Timer1_Timer()
Timer1.Interval = 500
If Label1.Caption <> CStr(Time$) Then
Label1.Caption = Time$
End If
End Sub

比如说在text1中显示时间
在form中拖一个timer

Private Sub Form_Load()
Timer1.Interval = 1000
End Sub

Private Sub Timer1_Timer()
Text1.Text = Format(Time, "hh.mm.ss")
End Sub

private sub timer1_timer()
timer1.interval=1000
print time()
end sub

这样就在窗体上显示当前时间了