0
Public Class Form1
Dim num1 As Integer = CInt(Int((10 * Rnd()) + 1))
Dim num2 As Integer = CInt(Int((10 * Rnd()) + 1))
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load



End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    ' It is meant to display the question on textbox2.text, not the answer
    TextBox2.Text = num1 * num2
End Sub

Private Sub TextBox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox1.TextChanged
    If TextBox1.Text = num1 * num2 Then
        Label2.Text = "Correct!!11"
    Else
        Label2.Text = "Incorrect, sorry about that"
    End If
End Sub

End Class

我希望 textbox2 显示类似“5 * 5”的问题,但它只显示“25”

4

1 回答 1

2

您将值分配给文本框作为 num1 和 num2 的乘积。您需要像这样连接字符串值

TextBox2.Text = num1 & " * " & num2 
于 2013-06-11T13:37:49.017 回答