Exemple #1
0
        public IToolBar Add(string id)
        {
            ToolStrip toolStrip = new ToolStrip();

            toolStrip.Text = id;

            ToolStripPanel toolStripPanel = m_toolStripContainer.TopToolStripPanel;

            toolStripPanel.Controls.Add(toolStrip);

            ToolBarBridge toolBarBridge = new ToolBarBridge(toolStrip, false);

            m_toolBars.Add(toolBarBridge);
            return(toolBarBridge);
        }
Exemple #2
0
        public void Remove(IToolBar toolBar)
        {
            ToolBarBridge toolBarBridge = (ToolBarBridge)toolBar;

            if (!m_toolBars.Contains(toolBarBridge))
            {
                throw new Exception("Cannot remove a toolbar that is not in the tool strip container");
            }

            if (toolBar.ReadOnly)
            {
                throw new Exception("Cannot remove a built-in toolbar");
            }

            ToolStrip toolStrip = toolBarBridge.ToolStrip;

            toolStrip.Parent.Controls.Remove(toolStrip);

            m_toolBars.Remove(toolBarBridge);
        }
Exemple #3
0
        public IToolBar Add(string id)
        {
            ToolStrip toolStrip = new ToolStrip();
            toolStrip.Text = id;

            ToolStripPanel toolStripPanel = m_toolStripContainer.TopToolStripPanel;

            toolStripPanel.Controls.Add(toolStrip);

            ToolBarBridge toolBarBridge = new ToolBarBridge(toolStrip, false);

            m_toolBars.Add(toolBarBridge);
            return toolBarBridge;
        }