示例#1
0
        /// <summary>
        /// Adds a new page/tab.
        /// </summary>
        /// <param name="label">Tab label.</param>
        /// <param name="page">Page contents.</param>
        /// <returns>Newly created control.</returns>
        public TabPage AddPage(string label, ControlBase page = null)
        {
            TabButton button  = new TabButton(m_TabStrip);
            var       tabpage = new TabPage(this, button);

            tabpage.Name = label;
            button.SetText(label);
            button.Page      = tabpage;
            button.IsTabable = false;
            if (page != null)
            {
                tabpage.AddChild(page);
            }
            AddPage(button);
            return(tabpage);
        }
示例#2
0
        /// <summary>
        /// Adds a new page/tab.
        /// </summary>
        /// <param name="label">Tab label.</param>
        /// <param name="page">Page contents.</param>
        /// <returns>Newly created control.</returns>
        public TabButton AddPage(string label, ControlBase page = null)
        {
            if (null == page)
            {
                page = new ControlBase(this);
            }
            else
            {
                page.Parent = this;
            }

            TabButton button = new TabButton(m_TabStrip);

            button.SetText(label);
            button.Page      = page;
            button.IsTabable = false;

            AddPage(button);
            return(button);
        }