1.vbʱ?时间时间?Դ??
2.求一个VB秒表的源代码,精确至0.01秒
vbʱ?源码office源码编码?Դ??
Private Sub Form_Load()
Timer1.Interval = '这个改成 有一定缓冲时间
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim timey, timem, timed, timeh, timemi, i As String
Dim tim As Integer
timey = CStr(Year(Now))
timem = CStr(Month(Now))
timed = CStr(Day(Now))
timeh = CStr(Hour(Now))
timemi = CStr(Minute(Now))
If Val(timeh) > Then
i = "PM"
tim = Val(timeh) -
Else
i = "AM"
End If
Label1.Caption = "现在的时间是:" & timey & "年" & timem & "月" & timed & "日" & i & (CStr(tim)) & "时" & timemi & "分"
End Sub
另外帖上一个源代码供你参考
============================================
Private Sub Form_Load()
Me.Caption = Year(Date) & "年" & Month(Date) & "月" & Day(Date) & "日 星期" & GetWD(Weekday(Date)) & " 系统时间" & Format$(Time, "hh:mm:ss")
Timer1.Interval =
End Sub
'xx年xx月xx日 星期几 系统时间hh:mm:ss
Private Sub Timer1_Timer()
Me.Caption = Year(Date) & "年" & Month(Date) & "月" & Day(Date) & "日 星期" & GetWD(Weekday(Date)) & " 系统时间" & Format$(Time, "hh:mm:ss")
'"xx年xx月xx日 星期几 系统时间hh:mm:ss"
End Sub
Function GetWD(ByVal Week As Integer) As String
Select Case Week
Case 1
GetWD = "日"
Case 2
GetWD = "一"
Case 3
GetWD = "二"
Case 4
GetWD = "三"
Case 5
GetWD = "四"
Case 6
GetWD = "五"
Case 7
GetWD = "六"
End Select
End Function
求一个VB秒表的源代码,精确至0.秒
1)
启动visual basic6.0 ,代码ksdk源码分析打开一个新的时间时间mc源码分析标准工程。
2)
在窗体上Form1上添加6个标签空间(Label) 2个命令按钮(CommandButton)和1个计时器(Timer)。源码to string源码命令按钮的代码密友插件源码Caption属性分别为“启动”“停止”
Timer1的Interval属性为
Label1 Label2 Label3的Caption属性分别为“开始时间”“结束时间”“经过时间” Timer1的Enable属性为False
3)代码
Dim Starttime As Variant
Dim End time As Variant
Dim Elapsed As Variant
Private Sub cmdStart_Click()
'显示开始时间
lblStart.Caption=Time$
Starttime=Now
'启动时钟控件
Timer1.Enabled=Ture
End Sub
Private Sub cmdStop_Click()
'记录停止时间
Endtime=Now
'关闭时钟控件
Timer1.Enabled=False
'显示经过时间
lblApaed.Caption=Format(Endtime-Starttime,"hh:mm:ss"
End Sub
Private Sub Timer1_Timer()
lblStop.Caption=Time$
End Sub
以上是用VB6.0实现的