Private Sub Command1_Click()
Dim a As Integer, b As Integer
a = Val(Text1.Text)
b = Val(Text2.Text)
Label1.Caption = "较小的数是:"
If a < b Then
Label1.Caption = Label1.Caption & a
Else
Label1.Caption = Label1.Caption & b
End If
End Sub
已经运行过,有什么问题请留言。
Private Sub Command1_Click()
Label1.Caption = IIf(Val(Text1.Text) < Val(Text2.Text), Val(Text1.Text), Val(Text2.Text))
End Sub