예제 #1
0
 protected void OnPageSelected(NetTabPage page)
 {
     if (PageSelected != null)
     {
         PageSelected(this, new NetPageSelectedEventArgs(page));
     }
 }
        protected override void OnInsertComplete(int index, object value)
        {
            NetTabPage page = value as NetTabPage;

            SetUpPage(page);
            if (InsertComplete != null)
            {
                InsertComplete(this, new NetTabPageEventArgs(index, page));
            }
        }
예제 #3
0
        protected override void OnControlAdded(ControlEventArgs e)
        {
            base.OnControlAdded(e);
            NetTabPage page = e.Control as NetTabPage;

            if (page != null && string.IsNullOrEmpty(page.Title))
            {
                page.Title = page.Name;
            }
        }
예제 #4
0
        protected bool OnCanPageSelect(NetTabPage page)
        {
            if (PageSelecting != null)
            {
                NetPageSelectedEventArgs e = new NetPageSelectedEventArgs(page);
                PageSelecting(this, e);
                return(e.CanSelect);
            }

            return(true);
        }
        void SetUpPage(NetTabPage page, bool hidePage = true)
        {
            page.SuspendLayout();
            page.Visible &= !hidePage;

            int width  = owner.Size.Width;
            int height = owner.Size.Height;

            if (owner.Alignment == TabAlignment.Left || owner.Alignment == TabAlignment.Right)
            {
                width  -= owner.TabHeight + 1;
                height -= 2;
            }
            else
            {
                width  -= 2;
                height -= owner.TabHeight + 1;
            }

            page.Size = new Size(width, height);

            switch (owner.Alignment)
            {
            case TabAlignment.Left:
                page.Location = new Point(owner.TabHeight, 1);
                break;

            case TabAlignment.Top:
                page.Location = new Point(1, owner.TabHeight);
                break;

            default:
                page.Location = new Point(1, 1);
                break;
            }

            page.ResumeLayout(false);
        }
 public NetPageSelectedEventArgs(NetTabPage page)
 {
     this.page      = page;
     this.CanSelect = true;
 }
 public int IndexOf(NetTabPage tabPage)
 {
     return(List.IndexOf(tabPage));
 }
 public bool Contains(NetTabPage tabPage)
 {
     return(List.Contains(tabPage));
 }
 public void Insert(int index, NetTabPage tabPage)
 {
     List.Insert(index, tabPage);
 }
예제 #10
0
 public void Remove(NetTabPage tabPage)
 {
     List.Remove(tabPage);
 }
예제 #11
0
 public int Add(NetTabPage tabPage)
 {
     return(List.Add(tabPage));
 }
예제 #12
0
 public NetTabPageEventArgs(int index, NetTabPage oldPage, NetTabPage newPage)
 {
     this.newPage = newPage;
     this.oldPage = oldPage;
     this.index   = index;
 }
예제 #13
0
 public NetTabPageEventArgs(int index, NetTabPage page)
 {
     this.index   = index;
     this.newPage = page;
 }