Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Dim str As String = TextBox1.Text
If Mid(str, 1, 1) = "p" Then
TextBox2.Text = "正确"
Else
TextBox2.Text = "错误"
End If
If Mid(str, 2, 1) = "2" Then
TextBox3.Text = "正确"
Else
TextBox3.Text = "错误"
End If
If Mid(str, 3, 1) = "x" Then
TextBox4.Text = "正确"
Else
TextBox4.Text = "错误"
End If
End Sub
Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
Dim str As String = txtbox1.text
If String.Compare(str.Substring(0, 1), "p") = 0 Then
txtbox2.text = "正确"
End If
If String.Compare(str.Substring(1, 1), "2") = 0 Then
txtbox3.text = "正确"
End If
If String.Compare(str.Substring(2, 1), "x") = 0 Then
txtbox4.text = "正确"
End If
End Sub