环境:Net2.0调用时直接Utility.ChangeChildEditMode(this.Form, false); public static void ChangeChildEditMode(Control con, bool blnEditMode) { int i = 0; foreach (Control c in con.Controls) { if (c is TextBox) { ((TextBox)c).Enabled = blnEditMode; } else if (c is Button) { ((Button)c).Enabled = blnEditMode; } else if (c is DropDownList) { ((DropDownList)c).Enabled = blnEditMode; } else if (c is ListBox) { ((ListBox)c).Enabled = blnEditMode; } else if (c is CheckBox) { ((CheckBox)c).Enabled = blnEditMode; } else if (c is CheckBoxList) { ((CheckBoxList)c).Enabled = blnEditMode; } else if (c is RadioButton) { ((RadioButton)c).Enabled = blnEditMode; } else if (c is RadioButtonList) { ((RadioButtonList)c).Enabled = blnEditMode; } else if (c is HyperLink) { ((HyperLink)c).Enabled = blnEditMode; } else if (c.HasControls()) { ChangeChildEditMode(c, blnEditMode); i++; } } } 转载于:https://www.cnblogs.com/602544/archive/2006/12/09/587637.html