我正在编写一个从活动目录读取用户详细信息的脚本,它读取用户 samid 并将他的所有详细信息拉到文本框中以显示;在这里,我使用单选按钮来启用/禁用所有这些文本。即单选按钮在 2 种模式之间切换,读取模式/写入模式启用和禁用这些文本框,以便可以编辑它们并可以提交更改。
这是问题,默认情况下,读取模式单选按钮被选中并且每个文本框都被禁用,当我检查写入模式按钮时,一切都被启用,但它仍然存在。当我再次检查读取模式按钮时,它不会禁用这些框;我尝试了表单刷新,但没有用;如果有其他选择,请告诉我。
function ReadAD( $object )
{
$TextBox2.Enabled = "False"
$TextBox3.Enabled = "False"
$TextBox4.Enabled = "False"
$TextBox5.Enabled = "False"
$TextBox6.Enabled = "False"
$TextBox7.Enabled = "False"
$TextBox8.Enabled = "False"
$TextBox9.Enabled = "False"
$RichTextBox1.Enabled = "False"
$Button4.Visible = "False"
$form1.refresh()
}
function WriteAD( $object )
{
$TextBox2.Enabled = "False"
$TextBox3.Enabled = "False"
$TextBox4.Enabled = "False"
$TextBox5.Enabled = "False"
$TextBox6.Enabled = "False"
$TextBox7.Enabled = "False"
$TextBox8.Enabled = "False"
$TextBox9.Enabled = "False"
$RichTextBox1.Enabled = "False"
$Button4.Visible = "False"
$form1.refresh()
}