Exemple #1
0
        public ToolBarDockHolder(ToolBarManager dm, Control c, DockStyle style)
        {
            InitializeComponent();
            this.SetStyle(
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.UserPaint |
                ControlStyles.DoubleBuffer, true);

            _panel.Controls.AddRange(new Control[] { c });
            DockManager = dm;
            if (style == DockStyle.Left)
            {
                _preferredDockedArea = dm.Left;
            }
            else if (style == DockStyle.Right)
            {
                _preferredDockedArea = dm.Right;
            }
            else if (style == DockStyle.Bottom)
            {
                _preferredDockedArea = dm.Bottom;
            }
            else
            {
                _preferredDockedArea = dm.Top;
            }
            _control                  = c;
            FloatForm.Visible         = false;
            FloatForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            FloatForm.MaximizeBox     = false;
            FloatForm.MinimizeBox     = false;
            FloatForm.ShowInTaskbar   = false;
            FloatForm.ClientSize      = new Size(10, 10);
            // Added by mav
            DockManager.MainForm.AddOwnedForm(FloatForm);
            DockStyle    = style;
            ToolbarTitle = c.Text;
//			_control.TextChanged += new EventHandler(control_TextChanged);
        }
Exemple #2
0
        public ToolBarDockArea(ToolBarManager dockManager, DockStyle dockStyle)
        {
            InitializeComponent();

            this.SetStyle(
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.DoubleBuffer, true);

            _dockManager = dockManager;
            DockManager.DockStation.Controls.Add(this);
            if (dockStyle == DockStyle.Fill || dockStyle == DockStyle.None)
            {
                dockStyle = DockStyle.Top;
            }

            this.Dock = dockStyle;
            this.SendToBack();

            FitHolders();

            this.Layout += new LayoutEventHandler(LayoutHandler);
        }