DevExpress中,添加Winform窗体到DockPanel

Posted on 2012-03-31 10:29  呱唧  阅读(1580)  评论(1编辑  收藏  举报

在使用DevExpress过程中,原先已经创建好的导航窗体,如何添加到DockPanel中进行展示?

            FormX frmX = new FormX();

            frmX.Show(this.DockPanel1);            

    frmX.Dock = DockStyle.Fill;            

        frmX.TopLevel = false;            

    frmX.FormBorderStyle = FormBorderStyle.None;            

    this.DockPanel1.Text = frmX.Text;            

    this.DockPanel1.TabText = frmX.Text;            

    this.DockPanel1.Controls.Add(frmX);            

这样处理即可,如果DockPanel是动态创建的。需要这样来写:

DockPanel panelX = new DockPanel();            

panelX = this.DockManager1.AddPanel(DockingStyle.Left);

然后将上面的DockPanel1替换成panelX即可。

Copyright © 2024 呱唧
Powered by .NET 9.0 on Kubernetes