在WebForm中,可以使用反射将业务对象绑定到 ASP.NET 窗体控件.最近做Winform项目,也参考WebForm中的代码实现同样的功能. Winform没有提供类似WebForm中的FindControl方法,我于是用遍历控件的方式,写了一个类似WebForm中的这个方法,考虑到Winform中的很多控件放在Label.TabControl中,方法采用了递归的方式. Winform和Winform的控件也有些区别,如在Winform中,DateTimePicker取值是
Demo this.listView1.Visible = true; this.listView1.BeginUpdate();this.listView1.EndUpdate(); //结束数据处理,UI界面一次性绘制 using System; using System.Collections.Generic; using System.Windows.Forms; using System.Threading; namespace 子线程操作主线程窗体上的控件 { public part