'函数Command1_Click(), 调用函数Max()
'函数Max()返回最大值
Private Sub Command1_Click()
Dim aa As Integer
Dim bb As Integer
aa = Text1.Text
bb = Text2.Text
MsgBox Max(aa, bb)
End Sub
Max(a As Integer, b As Integer) As Integer
If a > b Then
Max = a
Else
Max = b
End If
End