Private Sub Command1_Click()
Dim a, b As Integer
Dim s As String
Randomize
a = Int(Rnd() * 100)
b = Int(Rnd() * 100)
s = CStr(a)
Label1.Caption = s
s = CStr(b)
Label2.Caption = s
End Sub
Private Sub Command2_Click()
Dim a, b, c As Integer
a = CInt(Label1.Caption)
b = CInt(Label2.Caption)
c = CInt(Text1.Text)
If (a + b = c) Then
Command2.Caption = "正确"
Else
Command2.Caption = "错误"
End If
End Sub
Private Sub Form_Load()
Label1.Caption = ""
Label2.Caption = ""
Text1.Text = ""
End Sub