Пример #1
0
        /// <summary>
        /// Removes specified tab page from the collection.
        /// </summary>
        /// <param name="tabPage">TabPage to remove.</param>
        /// <exception cref="ArgumentNullException">Is raised when <b>tabPage</b> is null reference.</exception>
        public void Remove(WTabPage tabPage)
        {
            if (tabPage == null)
            {
                throw new ArgumentNullException("tapPage");
            }

            m_pItems.Remove(tabPage.Key);
            m_pTabControl.TabBar.Tabs.Remove(tabPage.Tab);
        }
Пример #2
0
        /// <summary>
        /// Is called when active tab has changed.
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">Event data.</param>
        private void m_pTab_TabChanged(object sender, TabChanged_EventArgs e)
        {
            WTabPage tabPage = (WTabPage)e.NewTab.Tag;

            tabPage.Dock = DockStyle.Fill;
            m_pPanel.Controls.Clear();
            m_pPanel.Controls.Add(tabPage);
            m_pActiveTab = tabPage;

            OnActiveTabChanged();
        }
Пример #3
0
        /// <summary>
        /// Adds new item to the coollection.
        /// </summary>
        /// <param name="key">Item key.</param>
        /// <param name="textID">Item caption text ID.</param>
        /// <param name="text">Item caption text.</param>
        /// <returns>Returns new created tab page.</returns>
        public WTabPage Add(string key, string textID, string text)
        {
            Tab tab = m_pTabControl.TabBar.Tabs.Add(string.IsNullOrEmpty(textID) || m_pTabControl.WText == null  ? text : m_pTabControl.WText[textID]);

            tab.TextID = textID;

            WTabPage tapPage = new WTabPage(key, tab);

            tab.Tag = tapPage;
            m_pItems.Add(key, tapPage);

            return(tapPage);
        }