Пример #1
0
 public void AddTabNavItem(MyTabNavItem item)
 {
     this.SuspendLayout();
     this.flowLayoutPanel.Controls.Add(item);
     this.ResumeLayout(false);
     this.TabNavItems.Add(item);
     this.ActiveTabNavItem(item);
 }
Пример #2
0
        public void AddPage(string header, Control content)
        {
            var page    = new MyTabPage(this, header, content);
            var navItem = new MyTabNavItem(this, page);

            TabNav.AddTabNavItem(navItem);
            TabPageBox.ActiveTabPage(page);
        }
Пример #3
0
        public void ActiveTabNavItem(MyTabNavItem item)
        {
            var old = this.TabNavItems.FirstOrDefault(nav => nav.IsActived == true);

            if (old == item)
            {
                return;
            }

            if (old != null)
            {
                old.IsActived = false;
            }
            item.IsActived = true;
        }
Пример #4
0
        public void RemoveTabNavItem(MyTabNavItem item)
        {
            MyTabNavItem nextItem = null;

            try
            {
                var index = this.flowLayoutPanel.Controls.IndexOf(item);
                this.flowLayoutPanel.Controls.Remove(item);
                this.TabNavItems.Remove(item);
                if (index > this.flowLayoutPanel.Controls.Count - 1)
                {
                    index = this.flowLayoutPanel.Controls.Count - 1;
                }
                nextItem = (MyTabNavItem)this.flowLayoutPanel.Controls[index];
            }
            catch
            {
            }
            if (nextItem != null)
            {
                TabControl.AcitveTabNavItem(nextItem);
            }
        }
Пример #5
0
 public void CloseTabPage(MyTabNavItem item)
 {
 }
Пример #6
0
 public void AcitveTabNavItem(MyTabNavItem item)
 {
     TabNav.ActiveTabNavItem(item);
 }