Dim ccb As WinForm.CheckBox = e.Form.Controls("模式CheckBox1") If ccb.Checked = True Then Dim pwd As String If InputPassWord(pwd,"提示","请输入密码:") Then If pwd = "369" Then ccb.Checked = True Else ccb.Checked = False MessageBox.show("密码错误,请重新输入!") End If Else ccb.Checked = False End If End If