VB大神求教。。在Form2按取消按钮,回到Form1的登录页面,如何把之前输入的用户名和密码清空?
这是Form2取消键的代码:Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Form1.Show()
Me.Close()
End Sub
End Class
这是Form1的:
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If (TextBox1.Text = "yufan") And (TextBox2.Text = "yu13425413205") Then
Form2.Show()
Me.Hide()
Else
TextBox1.Text = ""
TextBox2.Text = ""
MsgBox("密码或用户名不正确,请重新输入")
Exit Sub
End If
End Sub
谢谢哟!!