【VB开源代码栏目提醒】:网学会员在VB开源代码频道为大家收集整理了Ex5_10.frm提供大家参考,希望对大家有所帮助!
VERSION 5.00
Begin VB.Form Ex5_10
Caption = "Form1"
ClientHeight = 2250
ClientLeft = 60
ClientTop = 450
ClientWidth = 3375
LinkTopic = "Form1"
ScaleHeight = 2250
ScaleWidth = 3375
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "显示"
Height = 375
Left = 840
TabIndex = 4
Top = 1560
Width = 1095
End
Begin VB.TextBox Text2
Height = 375
Left = 1560
TabIndex = 3
Top = 960
Width = 1455
End
Begin VB.TextBox Text1
Height = 375
Left = 1560
TabIndex = 1
Top = 240
Width = 1455
End
Begin
VB.Label Label2
Caption = "第二个参数"
Height = 255
Left = 480
TabIndex = 2
Top = 1080
Width = 975
End
Begin VB.Label Label1
Caption = "第一个参数"
Height = 255
Left = 480
TabIndex = 0
Top = 360
Width = 975
End
End
Attribute VB_Name = "Ex5_10"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Sub mysum(var1 As String, Optional var2 As Integer = 10)
'给可选参数设定默认值
Text1.Text = var1
Text2.Text = var2
End Sub
Private Sub Command1_Click()
Call mysum("abcd")
End Sub