📄 定时器延时.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 1000
Left = 1740
Top = 1350
End
Begin VB.CommandButton Command1
Caption = "开 始"
Height = 435
Left = 1680
TabIndex = 0
Top = 2490
Width = 1395
End
Begin VB.Label Label1
AutoSize = -1 'True
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 1590
TabIndex = 1
Top = 1080
Width = 180
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim I As Integer
Private Sub Form_Load()
Me.Caption = "单击命令按钮开始"
End Sub
Private Sub Command1_Click()
Me.Caption = "系统延时 10 秒"
Timer1.Enabled = True
I = 10
Print I
End Sub
Private Sub Timer1_Timer()
I = I - 1
Print I
If I = 1 Then
Timer1.Enabled = False
Me.Caption = "时间到"
Label1 = "时间到 !"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -