📄 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 = 375
Left = 600
TabIndex = 2
Top = 1680
Width = 2655
End
Begin VB.CommandButton Command1
Caption = "第1种执行带参数函数的方法"
Height = 375
Left = 600
TabIndex = 1
Top = 960
Width = 2655
End
Begin VB.TextBox Text1
Height = 375
Left = 600
TabIndex = 0
Top = 240
Width = 2655
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
'调用带参数函数
argumentfunction total, i
End Sub
'单击命令按钮command2后的执行代码
Private Sub Command2_Click()
Dim total As Integer
Dim i As Integer
total = 6
i = 2
'调用带参数函数
Call argumentfunction(total, i)
End Sub
'定义带参数函数
Function argumentfunction(argumenttotal As Integer, argumenti As Integer)
While argumenti <= argumenttotal
argumenti = argumenti + 1
Wend
Text1.Text = argumenttotal
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -