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)); } }
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; } }
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); }
public void Remove(NetTabPage tabPage) { List.Remove(tabPage); }
public int Add(NetTabPage tabPage) { return(List.Add(tabPage)); }
public NetTabPageEventArgs(int index, NetTabPage oldPage, NetTabPage newPage) { this.newPage = newPage; this.oldPage = oldPage; this.index = index; }
public NetTabPageEventArgs(int index, NetTabPage page) { this.index = index; this.newPage = page; }