WinFrom遍历窗体中的控件以及使用DevExpress容器中的控件
2014-04-18 16:40
1146 查看
//遍历Winform窗体中的控件,窗体中不加容器
foreach (System.Windows.Forms.Control control in this.Controls)
{
MessageBox.Show(t.Text);
}
//遍历Winform窗体中的控件,窗体中加 LayoutControl
foreach (System.Windows.Forms.Control item in layoutControl1.Controls)
{
if (item is DevExpress.XtraEditors.TextEdit)
{
(item as DevExpress.XtraEditors.TextEdit).Text = "";
}
}
foreach (System.Windows.Forms.Control control in this.Controls)
{
MessageBox.Show(t.Text);
}
//遍历Winform窗体中的控件,窗体中加 LayoutControl
foreach (System.Windows.Forms.Control item in layoutControl1.Controls)
{
if (item is DevExpress.XtraEditors.TextEdit)
{
(item as DevExpress.XtraEditors.TextEdit).Text = "";
}
}
相关文章推荐
- [导入]Winfrom中使用反射将业务对象绑定到窗体或控件容器
- 遍历winform窗体上的所有控件(包括DevExpress.XtraEditors控件)且对其做相应的处理
- DevExpress 使用 XtraTabbedMdiManager 控件以 Tab样式加载 Mdi窗体并合并 RibbonControl 解决方案
- Winform中使用控件名来查找窗体或者容器中的控件
- 在DevExpress程序中使用条形码二维码控件,以及进行报表打印处理
- Winform中使用控件名来查找窗体或者容器中的控件
- 遍历使用母版页的窗体取控件
- DevExpress 使用 XtraTabbedMdiManager 控件以 Tab样式加载 Mdi窗体并合并 RibbonControl 解决方案
- 使用EnumChildWindows函数遍历窗体上所有控件
- 在DevExpress程序中使用TeeList控件以及节点查询的处理
- DevExpress.XtraBars.Ribbon控件使用系列 (1)创建Ribbon窗体
- WinForm中使用反射将业务对象绑定到窗体或控件容器
- delphi 程序窗体及控件自适应分辨率(通过ComponentCount遍历改变字体大小以及上下左右)
- 关于使用Iterator时报NoSuchElementException错误的解决方案以及遍历容器的效率问题
- DevExpress 使用 XtraTabbedMdiManager 控件以 Tab样式加载 Mdi窗体并合并 RibbonControl 解决方案
- WinForm中使用反射将业务对象绑定到窗体或控件容器
- [DevExpress]程序中使用条形码二维码控件,以及进行报表打印处理
- C#使用tabcontrol控件可操作多窗体嵌入以及双击窗口名称可关闭
- 详解在DevExpress程序中使用TreeList控件以及节点查询的处理
- TestComplete中使用VBScript脚本实现对容器控件中子对象的遍历