コード例 #1
0
ファイル: FrmRuntime.cs プロジェクト: zj8487/HyDM
        public Control AddControl(Control ctrlTarget, enumDockPosition dockPosition)
        {
            Control ctrlNew = null;

            switch (dockPosition)
            {
            case enumDockPosition.Center:
                XtraTabPage tpNew = new XtraTabPage();
                this.tabCenter.TabPages.Add(tpNew);
                ctrlNew = tpNew;
                break;

            case enumDockPosition.Left:
                ctrlNew = this.dockManager1.AddPanel(DockingStyle.Left);   // this.dockPanelLeft.AddPanel();
                break;

            case enumDockPosition.Right:
                ctrlNew = this.dockManager1.AddPanel(DockingStyle.Right);   // this.dockPanelRight.AddPanel();
                break;

            case enumDockPosition.Top:
                ctrlNew = this.dockManager1.AddPanel(DockingStyle.Top);
                break;

            case enumDockPosition.Bottom:
                ctrlNew = this.dockManager1.AddPanel(DockingStyle.Bottom);
                break;

            default:
                ctrlNew = this.dockManager1.AddPanel(DockingStyle.Float);
                break;
            }

            if (ctrlTarget is System.ComponentModel.ISupportInitialize)
            {
                ((System.ComponentModel.ISupportInitialize)(ctrlTarget)).BeginInit();
            }

            ctrlNew.Controls.Add(ctrlTarget);
            ctrlTarget.Dock = System.Windows.Forms.DockStyle.Fill;

            if (ctrlTarget is System.ComponentModel.ISupportInitialize)
            {
                ((System.ComponentModel.ISupportInitialize)(ctrlTarget)).EndInit();
            }

            return(ctrlNew);
        }
コード例 #2
0
ファイル: FrmRuntime.cs プロジェクト: zj8487/HyDM
        public Control AddHooker(IHooker hooker, enumDockPosition dockPosition)
        {
            if (hooker == null)
            {
                return(null);
            }

            Control ctrlParent = AddControl(hooker.Control, dockPosition);

            ctrlParent.Text         = hooker.Caption;
            ctrlParent.Tag          = hooker;
            m_DictHooker[hooker.ID] = ctrlParent;

            if (ctrlParent is DockPanel)
            {
                (ctrlParent as DockPanel).Enter += new EventHandler(ChangeHook);
            }

            return(ctrlParent);
            //hooker.Control .GotFocus += new EventHandler(ChangeHook);
        }
コード例 #3
0
ファイル: FrmRuntime.cs プロジェクト: hy1314200/HyDM
        public Control AddHooker(IHooker hooker, enumDockPosition dockPosition)
        {
            if (hooker == null)
                return null;

            Control ctrlParent= AddControl(hooker.Control, dockPosition);
            ctrlParent.Text = hooker.Caption;
            ctrlParent.Tag = hooker;
            m_DictHooker[hooker.ID] = ctrlParent;

            if (ctrlParent is DockPanel)
                (ctrlParent as DockPanel).Enter+=new EventHandler(ChangeHook);

            return ctrlParent;
            //hooker.Control .GotFocus += new EventHandler(ChangeHook);
        }
コード例 #4
0
ファイル: FrmRuntime.cs プロジェクト: hy1314200/HyDM
        public Control AddControl(Control ctrlTarget, enumDockPosition dockPosition)
        {
            Control ctrlNew = null;
            switch (dockPosition)
            {
                case enumDockPosition.Center:
                    XtraTabPage tpNew = new XtraTabPage();
                    this.tabCenter.TabPages.Add(tpNew);
                    ctrlNew = tpNew;
                    break;

                case enumDockPosition.Left:
                    ctrlNew =this.dockManager1.AddPanel(DockingStyle.Left);// this.dockPanelLeft.AddPanel();
                    break;

                case enumDockPosition.Right:
                    ctrlNew =this.dockManager1.AddPanel(DockingStyle.Right);// this.dockPanelRight.AddPanel();
                    break;

                case enumDockPosition.Top:
                    ctrlNew = this.dockManager1.AddPanel(DockingStyle.Top);
                    break;

                case enumDockPosition.Bottom:
                    ctrlNew = this.dockManager1.AddPanel(DockingStyle.Bottom);
                    break;

                default:
                    ctrlNew= this.dockManager1.AddPanel(DockingStyle.Float);
                    break;
            }

            if (ctrlTarget is System.ComponentModel.ISupportInitialize)
                ((System.ComponentModel.ISupportInitialize)(ctrlTarget)).BeginInit();

            ctrlNew.Controls.Add(ctrlTarget);
            ctrlTarget.Dock = System.Windows.Forms.DockStyle.Fill;

            if (ctrlTarget is System.ComponentModel.ISupportInitialize)
                ((System.ComponentModel.ISupportInitialize)(ctrlTarget)).EndInit();

            return ctrlNew;
        }