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 に答える