我在程序中有一个密码表单,当你输入正确的密码时,它会将另一个表单高度从97更改为168.它以前一直工作但是由于某种原因,在不改变代码中的东西的情况下,已停止改变高度,给我一个错误。这是代码。
If TextBoxX1.Text = "**********" Then
Me.Hide()
Do Until Form1.Height = 168
Form1.Height = Form1.Height + 1
Loop
Form1.ButtonItem16.Enabled = False
Me.Close()
Else
If Slider1.Value = "0" Then
Slider1.Value = 33
ElseIf Slider1.Value = "33" Then
Slider1.Value = 66
ElseIf Slider1.Value = "66" Then
Slider1.Value = 99
End If
If Slider1.Value = "33" Then
TextBoxX1.Text = ""
MessageBoxEx.Show("Password Incorrect. You have 2 tries left.")
ElseIf Slider1.Value = "66" Then
TextBoxX1.Text = ""
MessageBoxEx.Show("Password Incorrect. You have 1 try left.")
ElseIf Slider1.Value = "99" Then
TextBoxX1.Text = ""
MessageBoxEx.Show("Password Incorrect. You have 0 tries left.")
Form1.ButtonItem16.Enabled = False
Me.Close()
End If
以下是它的说法:
“NullRefernceException未处理”“对象引用未设置为对象的实例。”