C# 一个MDI窗体怎样在加载子窗体时,使子窗体为最大化,我的windowstate属性设置了的啊代码如下 
click的
             Addofficer Addofficer1 = new Addofficer();
            Addofficer1.MdiParent = this;
            Addofficer1.Show();
Addofficer1的:
           this.WindowState = FormWindowState.Maximized;
            this.FormBorderStyle = FormBorderStyle.None; 
            this.ControlBox = false;
            this.Menu = null;

解决方案 »

  1.   

    Addofficer Addofficer1 = new Addofficer();
    Addofficer1.MdiParent = this;
    Addofficer1.WindowState = FormWindowState.Maximized;
    Addofficer1.Show();
      

  2.   

    那一句加了也没用啊,,那个form的状态已经是最大化了。。可是就是不把mdi全部填充了。。只显示一小部分。。而那个最大化按钮是变成了 还原的那种,说明已经是最大化了,可是没填充满Mdi
      

  3.   

    我这里测试可以最大化
    Addofficer Addofficer1 = new Addofficer();
    Addofficer1.MdiParent = this;
    Addofficer1.WindowState = FormWindowState.Maximized;
    Addofficer1.Show();
      

  4.   

    Addofficer Addofficer1 = new Addofficer();
    Addofficer1.MdiParent = this;
    Addofficer1.WindowState = FormWindowState.Maximized;
    Addofficer1.Show();然后把Addofficer1窗体里面的属性改回Normal!!具体为什么我也没搞清楚,就是在窗体里面改成Maximized后就无法放大的
      

  5.   

    ///<summary>
            ///打开子窗体
            ///</summary>
            public static void openChildrenWindow(System.Windows.Forms.Form parentWindow, System.Windows.Forms.Form childrenWindow)
            {
                foreach (System.Windows.Forms.Form ff in parentWindow.MdiChildren)
                {
                    //如果子窗体存在,激活子窗体
                    if (ff.Name == childrenWindow.Name)
                    {
                        ff.Activate();
                        ff.Size = ff.Parent.Size;
                        ff.WindowState = System.Windows.Forms.FormWindowState.Maximized;
                        ((frmMain)parentWindow).slblOperate.Text = ff.Text;                    return;
                    }
                }
                parentWindow.IsMdiContainer = true;
                childrenWindow.MdiParent = parentWindow;
                childrenWindow.WindowState =System.Windows.Forms.FormWindowState.Maximized;
                childrenWindow.Show();
                //childrenWindow.ControlBox = false;
            }调用       openChildrenWindow(this, new form());//this parentWindow,form要打开的窗体
      

  6.   

    ((frmMain)parentWindow).slblOperate.Text = ff.Text;//请删除
      

  7.   

    this.ExistChildForm();
                Modifyclass Modifyclass1 = new Modifyclass();
                Modifyclass1.MdiParent = this;
                Modifyclass1.WindowState = System.Windows.Forms.FormWindowState.Maximized;
                this.ActivateMdiChild(Modifyclass1);
                Modifyclass1.Show();
    我找同学改成这样就行了,,现在过来看看,txt_ly说得很好啊,,分数就给你吧,,。。谢谢咯。。
      

  8.   

    头疼,看来效果还会不尽人意!!!!!!!!!!!!!
     ff.Size   =   ff.Parent.Size; //只是实现子窗体的大小与其父窗体一样大!
    但是不能铺满啊,不知各位仁兄还有什么高招啊,指点小弟一二!感激不尽!
      

  9.   

    //this.ExistChildForm();                         Modifyclass   Modifyclass1   =   new   Modifyclass(); 
                            Modifyclass1.MdiParent   =   this; 
                            Modifyclass1.WindowState   =   System.Windows.Forms.FormWindowState.Maximized; 
                            this.ActivateMdiChild(Modifyclass1); 
                            Modifyclass1.Show();   楼上的这个方法是可以的,感谢!但这一句“this.ExistChildForm()“;好像不存在??