//遍历Winform窗体中的控件,窗体中不加容器
foreach (System.Windows.Forms.Control control in this.Controls)
{
MessageBox.Show(t.Text);
}
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 = "";
}
}
{
if (item is DevExpress.XtraEditors.TextEdit)
{
(item as DevExpress.XtraEditors.TextEdit).Text = "";
}
}