1. 程式人生 > >MDI 父親窗體遍歷子窗體

MDI 父親窗體遍歷子窗體

foreach (Form child in this.MdiChildren)
{
    /****************FormCont是使用者已經定義的子視窗****************/
    if ("FormCont" == child.Name)
    {
                   
        child.Size = new Size(200, this.ClientSize.Height);
        child.StartPosition = FormStartPosition.Manual;
        child.Location = new Point(0, 0);
                 
                
    }
    
    if ("FormCurrent" == child.Name)
    {
        child.Size = new Size(this.ClientSize.Width - 400, this.ClientSize.Height - 300);
        child.StartPosition = FormStartPosition.Manual;
        child.Location = new Point(200, 0);

    }
    
    if ("FormError" == child.Name)
    {

        child.Size = new Size(this.ClientSize.Width - 400, 300);
        child.StartPosition = FormStartPosition.Manual;

        child.Location = new Point(200, this.ClientSize.Height - child.Height);
                
    }
                
               
}