Private Sub Command1_Click()
If Text1.Text <> "" And Text2.Text <> "" Then
Call qiuzhi(CInt(Text1.Text), CInt(Text2.Text))
Else
MsgBox "请输入两个数"
End If
End Sub
Private Function qiuzhi(ByVal m, n As Integer)
Dim max, min As Integer
If m > n Then
max = m
min = n
Else
max = n
min = m
End If
MsgBox "最大值是:" & max & ";最小值是:" & min
End Function
Private Sub Form_Click()
Dim a As Integer, b As Integer
a = InputBox("a=")
b = InputBox("b=")
Print "较大的数是:" & big(a, b)
End Sub
Private Function big(a As Integer, b As Integer) As Integer
If a > b Then big = a Else big = b
End Function
这不是经典例题中的吗???借本书去看吧,那上面有的