Exemplo n.º 1
0
 public void AddTabNavItem(MyTabNavItem item)
 {
     this.SuspendLayout();
     this.flowLayoutPanel.Controls.Add(item);
     this.ResumeLayout(false);
     this.TabNavItems.Add(item);
     this.ActiveTabNavItem(item);
 }
Exemplo n.º 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);
        }
Exemplo n.º 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;
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 5
0
 public void CloseTabPage(MyTabNavItem item)
 {
 }
Exemplo n.º 6
0
 public void AcitveTabNavItem(MyTabNavItem item)
 {
     TabNav.ActiveTabNavItem(item);
 }