你說的前面意思沒聽懂,後面希望毫秒到是可以實現,但微秒不會。上程式碼:加一個label和一個timer: Private Declare Sub GetLocalTime Lib "kernel32" (lpSystemTime As SYSTEMTIME) Private Type SYSTEMTIME wYear As Integer wMonth As Integer wDayOfWeek As Integer wDay As Integer wHour As Integer wMinute As Integer wSecond As Integer wMilliseconds As Integer End Type Private Sub Form_Load() Timer1.Interval = 1 End Sub Private Sub Timer1_Timer() Dim t As SYSTEMTIME GetLocalTime t Cls Label1.Caption = DateSerial(t.wYear, t.wMonth, t.wDay) & " " & TimeSerial(t.wHour, t.wMinute, t.wSecond) & "." & t.wMilliseconds End Sub
你說的前面意思沒聽懂,後面希望毫秒到是可以實現,但微秒不會。上程式碼:加一個label和一個timer: Private Declare Sub GetLocalTime Lib "kernel32" (lpSystemTime As SYSTEMTIME) Private Type SYSTEMTIME wYear As Integer wMonth As Integer wDayOfWeek As Integer wDay As Integer wHour As Integer wMinute As Integer wSecond As Integer wMilliseconds As Integer End Type Private Sub Form_Load() Timer1.Interval = 1 End Sub Private Sub Timer1_Timer() Dim t As SYSTEMTIME GetLocalTime t Cls Label1.Caption = DateSerial(t.wYear, t.wMonth, t.wDay) & " " & TimeSerial(t.wHour, t.wMinute, t.wSecond) & "." & t.wMilliseconds End Sub