dockManager 添加DockPanel控件

.

控件:

dockManager、barManager
  foreach (DockPanel p in dockManager1.Panels)
            {
                p.Show();
                p.Visibility = DockVisibility.Hidden;
            }

 

 

添加选卡

DockingStyle.Left,DockingStyle.Right,DockingStyle.Bottom
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            DockPanel d = dockManager1.AddPanel(DockingStyle.Left);
            this.Controls.Add(d);

            d.Dock = DevExpress.XtraBars.Docking.DockingStyle.Left;

            d.ID = new System.Guid();
            d.Location = new System.Drawing.Point(70,70);
            d.Name = "dockPanenContainer";
            d.OriginalSize = new System.Drawing.Size(200, 351);
            d.SavedIndex = 0;
            d.Size = new System.Drawing.Size(200, 200);
            d.MouseUp += D_MouseUp;
            d.Show();
        }

        private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            DockPanel d = dockManager1.AddPanel(DockingStyle.Top);
            this.Controls.Add(d);
            d.ID = new System.Guid();
            d.Location = new System.Drawing.Point(70, 70);
            d.Name = "dockPanenContainer";
            d.OriginalSize = new System.Drawing.Size(200, 351);
            d.SavedIndex = 0;
            d.Size = new System.Drawing.Size(200, 200);
            d.MouseUp += D_MouseUp;
            d.Show();
        }

        private void barButtonItem3_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {

            DockPanel d = dockManager1.AddPanel(DockingStyle.Right);
            this.Controls.Add(d);
            d.ID = new System.Guid();
            d.Location = new System.Drawing.Point(70, 70);
            d.Name = "dockPanenContainer";
            d.OriginalSize = new System.Drawing.Size(200, 351);
            d.SavedIndex = 0;
            d.Size = new System.Drawing.Size(200, 200);
            d.MouseUp += D_MouseUp;
            d.Show();
        }

        private void barButtonItem4_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {

            DockPanel d = dockManager1.AddPanel(DockingStyle.Bottom);
            this.Controls.Add(d);
            d.ID = new System.Guid();
            d.Location = new System.Drawing.Point(70, 70);
            d.Name = "dockPanenContainer";
            d.OriginalSize = new System.Drawing.Size(200, 351);
            d.SavedIndex = 0;
            d.Size = new System.Drawing.Size(200, 200);
            d.MouseUp += D_MouseUp;
            
            d.Show();
        }

 

.

posted @ 2021-01-29 17:42  蓝雨冰城  阅读(377)  评论(0编辑  收藏  举报