Ejemplo n.º 1
0
        private void TabCaption_SelectedTab(object sender, EventArgs e)
        {
            TabCaption caption = (TabCaption)sender;
            Tab        tab     = FindTab(caption);

            if (caption.IsSelected())
            {
                SelectTab(tab);
            }
        }
Ejemplo n.º 2
0
        public void SelectTab(Tab tab)
        {
            TabCaption tabCaption  = tab.Caption;
            TabCaption selectedTab = captions.GetSelectedTab();

            if (selectedTab != null && !selectedTab.Equals(tabCaption))
            {
                selectedTab.SetSelected(false);
            }
            captions.SetSelectedTab(tabCaption);
            if (!tabCaption.IsSelected())
            {
                TabContent content = tab.Content;
                contentContainer.Controls.Remove(content);
            }
            else
            {
                TabContent content = tab.Content;
                contentContainer.Controls.Clear();
                contentContainer.Controls.Add(content);
                content.Focus();
            }
        }