一个窗口,一个文本框,用于输入密码。两个图片框,一个正确,一个错误。
要实现,输入密码正确时,就显示 正确的图片框。 结果 为什么 只能显示正确的图片,输入错误时,错误的图片却不显示。
我在窗口 afterload 写如下代码 :
e.Form.Controls("PictureBox1").Visible = False
e.Form.Controls("PictureBox2").Visible = False
在value changed 写入:
Dim mm As WinForm.TextBox = e.Form.Controls("密码")
If mm.Value = "123456" Then
e.Form.Controls("PictureBox1").Visible = True
e.Form.Controls("PictureBox2").Visible = False
End If
If mm.Value <> "123456" Then
e.Form.Controls("PictureBox1").Visible = False
e.Form.Controls("PictureBox2").Visible = True
End If