【VB开源代码栏目提醒】:网学会员鉴于大家对VB开源代码十分关注,论文会员在此为大家搜集整理了“6.3.2.frm”一文,供大家参考学习
VERSION 5.00
Begin VB.Form Form3
Caption = "Form3"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form3"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 615
Left = 1560
TabIndex = 0
Top = 1080
Width = 1215
End
End
Attribute
VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Function Average(a As Integer, b As Integer)
Average = (a + b) / 2
End Function
Private Sub Command1_Click()
'单击事件
Dim x As Integer, y As Integer
Dim result As Single
x = Val(InputBox("请输入第一个数"))
y = Val(InputBox("请输入第二个数"))
result = Average(x, y)
'调用过程
MsgBox "平均值为" & result
End Sub