this.Controls的到ControlCollection 集合
然后用
foreach(Control control in this.Controls)
{
  if(control is TextBox)
   ......
}
其他类型的类似;

解决方案 »

  1.   

    private void GetControl(Control c){ MessageBox.Show(c.Name); foreach (Control ch in c.Controls) GetControl(ch);}调用:
    GetControl(this);
      

  2.   

    foreach(Control con in this.Controls)
    {
    ............
    }
      

  3.   


    TextBox 控件的判断foreach(Control con in this.Controls)
    {
         if (con is TextBox)
         {
            // 那就是了
         }
    }
      

  4.   

    想知道所有窗体,最好作个ArrayList,声明一个往上面加一个,不要了,在删除,想知道就可以在上面找了。如果是MDI,可以通过子窗体查看
      

  5.   

    班兄的对了。。
    其他各位兄弟的都不能取到控件中的控件。。不过还是谢谢各位大哥了。
    不过能不能取工程中所有窗体呢??
    请各位大哥?再帮个忙??
    xiaodele(小得乐) ( ) 能帮写点代码?
      

  6.   

    如果没新建一个窗体的时候,例如如下:
    //need a new one 
    frmForm myForm = new frmForm(); 
    this.AddOwnedForm(myForm); 那么可以如下获得所有窗体
    foreach ( Form f in this.OwnedForms )