您的位置:首页 > 其它

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 = "";

     }

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐