Inheritance: Control
Exemplo n.º 1
0
        public void AddTab(Control Panel, string tabTitle, bool SwitchTo = false)
        {
            if (Panel != null)
            {
                if (!Panel.Initialized)
                {
                    Panel.Initialize();
                }
                Panel.Parent = this;
                _pagelist.Add(Panel);
            }
            var bar = new TabBar(fnt, fntNoShadow)
            {
                Parent = this,
                Top    = 0,
                Left   = _tablist.Count * 120,
                Right  = _tablist.Count * 120,
                Margin = TabMargin,
            };

            bar.Initialize();
            bar.Parent = this;
            bar.TabID  = _tablist.Count;
            bar.Title  = tabTitle;
            bar.Click += SwitchTab;
            foreach (TabBar t in _tablist)
            {
                t.Selected = false;
            }
            _tablist.Add(bar);
            SwitchTab(_tablist.Count - 1);
        }
Exemplo n.º 2
0
 private void SwitchTab(object sender, EventArgs e)
 {
     _presentTab = (TabBar)sender;
     foreach (TabBar t in _tablist)
     {
         t.Selected = false;
     }
     _presentTab.Selected = true;
     _presentPage         = _pagelist[_presentTab.TabID];
 }
Exemplo n.º 3
0
 private void SwitchTab(object sender,EventArgs e)
 {
     _presentTab = (TabBar)sender;
     foreach (TabBar t in _tablist)
     {
         t.Selected = false;
     }
     _presentTab.Selected = true;
     _presentPage = _pagelist[_presentTab.TabID];
 }
Exemplo n.º 4
0
 public void AddTab(Control Panel, string tabTitle, bool SwitchTo = false)
 {
     if(Panel !=null)
     {
         if (!Panel.Initialized)
             Panel.Initialize();
         Panel.Parent = this;
         _pagelist.Add(Panel);
     }
     var bar = new TabBar(fnt,fntNoShadow)
     {
         Parent=this,
         Top=0,
         Left = _tablist.Count * 120,
         Right= _tablist.Count * 120,
         Margin = TabMargin,
     };
     bar.Initialize();
     bar.Parent = this;
     bar.TabID = _tablist.Count;
     bar.Title = tabTitle;
     bar.Click += SwitchTab;
     foreach (TabBar t in _tablist)
     {
         t.Selected = false;
     }
     _tablist.Add(bar);
     SwitchTab(_tablist.Count - 1);
 }