📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "第2种方法"
Height = 495
Left = 1320
TabIndex = 2
Top = 1920
Width = 2055
End
Begin VB.TextBox Text1
Height = 495
Left = 1320
TabIndex = 1
Text = "Text1"
Top = 360
Width = 2055
End
Begin VB.CommandButton Command1
Caption = "第1种方法"
Height = 495
Left = 1320
TabIndex = 0
Top = 1200
Width = 2055
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'单击按钮Command1后的执行代码
Private Sub Command1_Click()
Dim total As Integer
Dim i As Integer
total = 5
i = 1
'调用带参数Sub过程的第1种方法
argumentsub total, i
End Sub
'单击按钮Command2后的执行代码
Private Sub Command2_Click()
Dim total As Integer
Dim i As Integer
total = 6
i = 2
'调用带参数Sub过程的第2种方法
Call argumentsub(total, i)
End Sub
'定义带参数过程
Sub argumentsub(argumenttotal As Integer, argumenti As Integer)
While argumenti <= argumenttotal
Text1.Text = argumenti
Text1.Refresh
argumenti = argumenti + 1
Wend
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -