private void handlePrevPage(object sender, EventArgs e) { MultiPanelPage page = this.Control as MultiPanelPage; if (page.Parent is MultiPanel) { MultiPanel wiz = page.Parent as MultiPanel; wiz.PageIndex--; } }
private void selectParentContainer(object sender, EventArgs e) { MultiPanelPage page = this.Control as MultiPanelPage; page.Parent.Select(); /*if (page.Parent is MultiPanel) * { * MultiPanel wiz = page.Parent as MultiPanel; * * wiz.PageIndex--; * }*/ }
protected internal void ActivatePage(int index) { //If the new page is invalid if (index < 0 || index >= vPages.Count) { return; } //Change to the new Page MultiPanelPage tWizPage = ((MultiPanelPage)vPages[index]); //Really activate the page ActivatePage(tWizPage); }
protected internal void ActivatePage(MultiPanelPage page) { //Deactivate the current if (vActivePage != null) { vActivePage.Visible = false; } //Activate the new page vActivePage = page; if (vActivePage != null) { //Ensure that this panel displays inside the MultiPanel vActivePage.Parent = this; if (this.Contains(vActivePage) == false) { this.Container.Add(vActivePage); } //if (DesignMode && vActivePage.BackColor == SystemColors.Control) // vActivePage.BackColor = Color.FromArgb(this.Parent.BackColor.ToArgb()); //Make it fill the space vActivePage.Dock = DockStyle.Fill; vActivePage.Visible = true; vActivePage.BringToFront(); //vActivePage.FocusFirstTabIndex(); } //Cause a refresh if (vActivePage != null) { vActivePage.Invalidate(); } else { this.Invalidate(); } if (PageChanged != null) { PageChanged(this, EventArgs.Empty); } }
private void handleAddPage(object sender, EventArgs e) { MultiPanel wiz = this.Control as MultiPanel; IDesignerHost h = (IDesignerHost)GetService(typeof(IDesignerHost)); IComponentChangeService c = (IComponentChangeService)GetService(typeof(IComponentChangeService)); DesignerTransaction dt = h.CreateTransaction("Add Page"); MultiPanelPage page = (MultiPanelPage)h.CreateComponent(typeof(MultiPanelPage)); c.OnComponentChanging(wiz, null); //Add a new page to the collection wiz.Pages.Add(page); wiz.Controls.Add(page); wiz.ActivatePage(page); c.OnComponentChanged(wiz, null, null, null); dt.Commit(); }
/// <summary> /// Removes the given page from the collection /// </summary> /// <param name="value">Page to remove</param> public void Remove(MultiPanelPage value) { //Remove the item List.Remove(value); }
/// <summary> /// Adds a new page at a particular position in the Collection /// </summary> /// <param name="index">Position</param> /// <param name="value">Page to be added</param> public void Insert(int index, MultiPanelPage value) { List.Insert(index, value); }
/// <summary> /// Finds the position of the page in the colleciton /// </summary> /// <param name="value">Page to find position of</param> /// <returns>Index of Page in collection</returns> public int IndexOf(MultiPanelPage value) { return(List.IndexOf(value)); }
/// <summary> /// Removes the given page from the collection /// </summary> /// <param name="value">Page to remove</param> public void Remove( MultiPanelPage value ) { //Remove the item List.Remove( value ); }
/// <summary> /// Adds a new page at a particular position in the Collection /// </summary> /// <param name="index">Position</param> /// <param name="value">Page to be added</param> public void Insert( int index, MultiPanelPage value ) { List.Insert(index, value ); }
/// <summary> /// Finds the position of the page in the colleciton /// </summary> /// <param name="value">Page to find position of</param> /// <returns>Index of Page in collection</returns> public int IndexOf( MultiPanelPage value ) { return( List.IndexOf( value ) ); }
/// <summary> /// Adds an array of pages into the collection. Used by the Studio Designer generated coed /// </summary> /// <param name="pages">Array of pages to add</param> public void AddRange(MultiPanelPage[] pages) { // Use external to validate and add each entry foreach(MultiPanelPage page in pages) { this.Add(page); } }
/// <summary> /// Adds a MultiPanelPage into the Collection /// </summary> /// <param name="value">The page to add</param> /// <returns></returns> public int Add(MultiPanelPage value ) { int result = List.Add( value ); return result; }
protected internal void ActivatePage(MultiPanelPage page) { //Deactivate the current if (vActivePage != null) { vActivePage.Visible = false; } //Activate the new page vActivePage = page; if (vActivePage != null) { //Ensure that this panel displays inside the MultiPanel vActivePage.Parent = this; if (this.Contains(vActivePage) == false) { this.Container.Add(vActivePage); } //if (DesignMode && vActivePage.BackColor == SystemColors.Control) // vActivePage.BackColor = Color.FromArgb(this.Parent.BackColor.ToArgb()); //Make it fill the space vActivePage.Dock = DockStyle.Fill; vActivePage.Visible = true; vActivePage.BringToFront(); //vActivePage.FocusFirstTabIndex(); } //Cause a refresh if (vActivePage != null) vActivePage.Invalidate(); else this.Invalidate(); if (PageChanged != null) PageChanged(this, EventArgs.Empty); }
/// <summary> /// Detects if a given Page is in the Collection /// </summary> /// <param name="value">Page to find</param> /// <returns></returns> public bool Contains(MultiPanelPage value) { // If value is not of type Int16, this will return false. return(List.Contains(value)); }
/// <summary> /// Adds a MultiPanelPage into the Collection /// </summary> /// <param name="value">The page to add</param> /// <returns></returns> public int Add(MultiPanelPage value) { int result = List.Add(value); return(result); }
/// <summary> /// Detects if a given Page is in the Collection /// </summary> /// <param name="value">Page to find</param> /// <returns></returns> public bool Contains( MultiPanelPage value ) { // If value is not of type Int16, this will return false. return( List.Contains( value ) ); }