/// <summary> /// Displays a view /// </summary> /// <param name="view">The view to show</param> public void DisplayView(Views.BaseView view) { //remove all user controls for (int i = this.scMain.Panel2.Controls.Count - 1; i >= 0; i--) { this.scMain.Panel2.Controls[i].Dispose(); } //show the view view.Dock = DockStyle.Fill; this.scMain.Panel2.Controls.Add(view); }
/// <summary> /// Displays a view /// </summary> /// <param name="view">The view to show</param> public void DisplayView(Views.BaseView view) { //remove all user controls foreach (Control oControl in this.scMain.Panel2.Controls) { if (oControl is UserControl) { oControl.Dispose(); } } //show the view view.Dock = DockStyle.Fill; this.scMain.Panel2.Controls.Add(view); }