1
Vote

MyWinForm.ClearIBData会将作为显示用的DataLabel也清空

description


建议将 MyWinForm.ClearIBData方法重载,加入一个类似以下的方法:__防止格杀勿论__!____
    /// <summary>
    /// 清除窗体上的智能控件的值
    /// </summary>
    /// <param name="Controls">窗体控件集和</param>
    /// <param name="exclude">不希望被清空的控件类型</param>
    public static void ClearIBData(System.Windows.Forms.Form.ControlCollection Controls,List<Type> exclude)
    {
        //使用匿名委托
        UseDataControl clearData = delegate(IDataControl dataControl)
        {
            if (!exclude.Contains(dataControl.GetType()))
            {
                dataControl.SetValue("");
            }
        };
        DoDataControls(Controls, clearData);

    }

comments