📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 2610
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 2610
ScaleWidth = 4680
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton Command2
Caption = "RESET"
Height = 495
Left = 2760
TabIndex = 2
Top = 1920
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "STOP"
Height = 495
Left = 600
TabIndex = 1
Top = 1920
Width = 1215
End
Begin VB.Timer Timer1
Interval = 1
Left = 1200
Top = 1920
End
Begin VB.Label Label1
Alignment = 2 'Center
BeginProperty Font
Name = "Times New Roman"
Size = 48
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1335
Left = 120
TabIndex = 0
Top = 120
Width = 4455
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim s, ts, hs As Integer
Private Sub Command1_Click()
If Command1.Caption = "STOP" Then
Timer1.Enabled = False
Command1.Caption = "START"
Else
Command1.Caption = "STOP"
Timer1.Enabled = True
End If
End Sub
Private Sub Command2_Click()
Timer1.Enabled = True
s = 60
ts = 5
hs = 9
Label1.Caption = s & ":" & ts & hs
End Sub
Private Sub Form_Load()
Timer1.Enabled = True
s = 59
ts = 5
hs = 9
Label1.Caption = s & ":" & ts & hs
End Sub
Private Sub Timer1_Timer()
If Not hs = 0 Then
hs = hs - 1
Else
ts = ts - 1
hs = 9
End If
If ts = 0 Then
s = s - 1
ts = 5
End If
If s = -1 Then
s = 0
ts = 0
hs = 0
'MsgBox s & ":" & ts & hs
Timer1.Enabled = False
End If
Label1.Caption = s & ":" & ts & hs
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -