[控件]DockPanel里如何在一个子窗体里打开另一个子窗体 显示在主窗体中?
DockPanel是个开源的控件期待高手回答

解决方案 »

  1.   

    没用过 DockPanel 获取子窗体的Paint 看
    Form _Form = new Form();
    _Form.TopLevel = false;
    _Form.Paint = this.Parent;
    _Form.Show();
      

  2.   

    如何在一个子窗体里打开另一个子窗体 显示在主窗体中? 
    这个问题好像和DockPanel没有关系的,只要你能把窗体显示到DockPanel中,然后就可以从这个窗体中打工你的子窗体了,
      

  3.   

    在主窗体里设置        
             public DockPanel DockPanel
            {
                get
                {
                    return this.dockPanel;
                }
            }
    在要打开新子窗体的子窗体中设置
            
    uiConfig uiCfig = new uiConfig();                if (((Main_frm)GetTopParent(this)).DockPanel.DocumentStyle == DocumentStyle.SystemMdi)
                    {
                        uiCfig.MdiParent = (Main_frm)GetTopParent(this);
                        uiCfig.Show();
                    }
                    else
                        uiCfig.Show(((Main_frm)GetTopParent(this)).DockPanel);
      

  4.   


     private Control GetTopParent(Control control)
            {
                while (control.Parent != null)
                {
                    control = control.Parent;
                }
                return control;
            }