📄 frmlab3.frm
字号:
VERSION 5.00
Begin VB.Form frmLab3
Caption = "Report Time and Date at Regular Intervals"
ClientHeight = 6825
ClientLeft = 60
ClientTop = 450
ClientWidth = 9900
LinkTopic = "Form1"
ScaleHeight = 6825
ScaleWidth = 9900
StartUpPosition = 3 'Windows Default
Begin VB.HScrollBar HScroll1
Height = 375
Left = 3720
Max = 20
TabIndex = 9
Top = 3240
Width = 1575
End
Begin VB.TextBox Texttime
Height = 975
Left = 6480
TabIndex = 8
Text = "Text1"
Top = 720
Width = 1935
End
Begin VB.CommandButton Command1
Caption = "Show/Hide frmLab3"
Height = 735
Left = 720
TabIndex = 7
Top = 4200
Width = 2055
End
Begin VB.CommandButton Command_Interval
Caption = "Update Interval Time"
Height = 855
Left = 3720
TabIndex = 3
Top = 4080
Width = 1815
End
Begin VB.TextBox IntervalTime
Height = 615
Left = 3840
TabIndex = 2
Text = "5000"
Top = 2400
Width = 1335
End
Begin VB.Timer Timer1
Interval = 1000
Left = 3000
Top = 3120
End
Begin VB.TextBox TxtDate
Height = 855
Left = 720
MaxLength = 30
TabIndex = 1
Text = "Text1"
Top = 2520
Width = 2055
End
Begin VB.TextBox TxtTime
Height = 975
Left = 720
MaxLength = 30
TabIndex = 0
Text = "Text2"
Top = 720
Width = 2055
End
Begin VB.Label Label4
Caption = "Numbers Of Seconds elapsed since Window Opened"
BeginProperty Font
Name = "Arial Unicode MS"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2535
Left = 6960
TabIndex = 10
Top = 2160
Width = 1335
End
Begin VB.Label Label3
Caption = "Update Time"
BeginProperty Font
Name = "Arial Unicode MS"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 3960
TabIndex = 6
Top = 840
Width = 1095
End
Begin VB.Label Label2
Caption = "Date"
BeginProperty Font
Name = "Arial Unicode MS"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1440
TabIndex = 5
Top = 3600
Width = 855
End
Begin VB.Label Label1
Caption = "Time"
BeginProperty Font
Name = "Arial Unicode MS"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1440
TabIndex = 4
Top = 1920
Width = 735
End
End
Attribute VB_Name = "frmLab3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdReport_Click()
TxtTime.Text = Time()
TxtDate.Text = Date
End Sub
Private Sub Command_Interval_Click()
Timer1.Interval = Val(IntervalTime.Text)
HScroll1.Value = Val(IntervalTime.Text) / 1000
intervalshowtime = HScroll1.Value
End Sub
Private Sub Command1_Click()
frmLab3.Hide
frm2Lab3.Show 0
frm2Lab3.Texttime.Text = 0
intervalshowtime = 1
Timer1.Interval = 1000
End Sub
Private Sub Form_Load()
intervalshowtime = 1
Timer1.Interval = 1000
End Sub
Private Sub HScroll1_Change()
IntervalTime.Text = HScroll1.Value * 1000
End Sub
Private Sub IntervalTime_Change()
If Val(IntervalTime.Text) > 20000 Then
IntervalTime.Text = "20000"
ElseIf Val(IntervalTime.Text) < 0 Then
IntervalTime.Text = "0"
End If
End Sub
Private Sub Timer1_Timer()
frmLab3.Texttime.Text = Val(frmLab3.Texttime.Text) + Val(intervalshowtime)
GetTimeData
TxtTime.Text = TimeVariable
TxtDate.Text = DateVariable
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -