Exemplo n.º 1
0
        public Panel_Toc(Control parentControl, ComboBox comboBox, Catalog helpCatalog)
        {
            InitializeComponent();

            this._cbo        = comboBox;
            this.HelpCatalog = helpCatalog;   //this will build the TOC

            // our oneshot timer
            oneshotTimer          = new Timer();
            oneshotTimer.Interval = 10;
            oneshotTimer.Tick    += new EventHandler(oneshotTimer_Tick);

            //Position under the ComboBox if one exists
            this.Parent = parentControl;
            if (_cbo != null)
            {
                // parent, size under the Cbo & Hide ourself
                Point cboPos = CalcCboPos();
                this.Left   = cboPos.X;
                this.Width  = _cbo.Width;
                this.Top    = cboPos.Y + _cbo.Height;
                this.Height = _cbo.Width;
                this.Hide();
                _cbo.DropDownHeight = 1;  // We are replacing the current dropdown so make the cbo dropdown as small as posible
            }
            this.BringToFront();

            //Update style
            if (Native.SetWindowTheme(this.treeView1.Handle, "explorer"))
            {
                treeView1.ShowLines = false;
            }

            tocSync = new TocSync(treeView1);
        }
Exemplo n.º 2
0
        public Panel_Toc(Control parentControl, ComboBox comboBox, Catalog helpCatalog)
        {
            InitializeComponent();

            this._cbo = comboBox;
            this.HelpCatalog = helpCatalog;   //this will build the TOC

            // our oneshot timer
            oneshotTimer = new Timer();
            oneshotTimer.Interval = 10;
            oneshotTimer.Tick += new EventHandler(oneshotTimer_Tick);

            //Position under the ComboBox if one exists
            this.Parent = parentControl;
            if (_cbo != null)
            {
                // parent, size under the Cbo & Hide ourself
                Point cboPos = CalcCboPos();
                this.Left = cboPos.X;
                this.Width = _cbo.Width;
                this.Top = cboPos.Y + _cbo.Height;
                this.Height = _cbo.Width;
                this.Hide();
                _cbo.DropDownHeight = 1;  // We are replacing the current dropdown so make the cbo dropdown as small as posible
            }
            this.BringToFront();

            //Update style
            if (Native.SetWindowTheme(this.treeView1.Handle, "explorer"))
                treeView1.ShowLines = false;

            tocSync = new TocSync(treeView1);
        }