|
暂时解决了。问题出现在采用递归设置Enabled属性。
- #region ConfigDisabled
- /// <summary>
- /// 设置控件为不可用。
- /// 如果控件含有子控件,将遍历子控件
- /// </summary>
- /// <param name="control"></param>
- /// <param name="isDisabled">true:不可用.false:可用</param>
- public static void ConfigDisabled(Control control, bool isDisabled)
- {
- if (control == null)
- {
- return;
- }
- if (control is FineUIPro.TextBox)
- {
- ((FineUIPro.TextBox)control).Enabled = !isDisabled;
- }
- else if (control is FineUIPro.DropDownList)
- {
- ((FineUIPro.DropDownList)control).Enabled = !isDisabled;
- }
- else if (control is FineUIPro.NumberBox)
- {
- ((FineUIPro.NumberBox)control).Enabled = !isDisabled;
- }
- else if (control is FineUIPro.DatePicker)
- {
- ((FineUIPro.DatePicker)control).Enabled = !isDisabled;
- }
- else if (control is FineUIPro.CheckBox)
- {
- ((FineUIPro.CheckBox)control).Enabled = !isDisabled;
- }
- else if (control is FineUIPro.RadioButton)
- {
- ((FineUIPro.RadioButton)control).Enabled = !isDisabled;
- }
- else if (control is FineUIPro.RadioButtonList)
- {
- ((FineUIPro.RadioButtonList)control).Enabled = !isDisabled;
- }
- else if (control is FineUIPro.TextArea)
- {
- ((FineUIPro.TextArea)control).Enabled = !isDisabled;
- }
- else if (control is FineUIPro.FileUpload)
- {
- ((FineUIPro.FileUpload)control).Enabled = !isDisabled;
- }
- else if (control is FineUIPro.Button)//没有Enabled属性,设置Enabled=false
- {
- ((FineUIPro.Button)control).Enabled = !isDisabled;
- }
- if (!control.HasControls())
- {
- return;
- }
- foreach (Control child in control.Controls)
- {
- ConfigDisabled(child, isDisabled);
- }
- }
- #endregion
复制代码
- //原先是这样调用
- Widget.ConfigDisabled(this, false);
- //现在改为
- Widget.ConfigDisabled(TabStrip1.ActiveTab, false);
- //问题应该是出现在对this的遍历上,导致界面上一直在转圈,具体为何还没有深究。
复制代码
|
|