private void showScreen(ScreenBase screen) { //set the active usercontrol UserControl src = (UserControl)_currScreen; UserControl uc = screen as UserControl; if (uc != null) { //copy the properties uc.Location = src.Location; uc.Size = src.Size; uc.Anchor = src.Anchor; this.Controls.Add(uc); lblScreenMessage.Text = screen.TitleMessage(); uc.Visible = true; uc.BringToFront(); _currScreen = screen; } //remove any other screens UserControl c; for (int i = this.Controls.Count - 1; i >= 0; i--) { c = this.Controls[i] as UserControl; if ((uc == null || c != uc) && c is ScreenBase) this.Controls.Remove(c); } btnMoveNext.Enabled = (_currScreen is ModsScreen || _currScreen is TrackSelectScreen || _currScreenIdx < _screens.Count - 1); btnMoveBack.Enabled = (_currScreen is TrackSelectScreen || _currScreenIdx > 0); btnMove.Enabled = (_currScreen is TrackEditScreen || _currScreen is NotesEditScreen || _currScreen is ProgressScreen); if (_currScreen != null) { _currScreen.Construct(_core.Project); _currScreen.Open(); } Application.DoEvents(); }
private void MainForm_Load(object sender, EventArgs e) { if (_exitApp) { this.Close(); } else { this.Text = string.Format("{0} - v{1} / v{2}", TheGhostCore.AppName, TheGhostCore.AppVersion, TheGhostCore.CoreVersion); btnMoveBack.Enabled = false; btnMove.Enabled = false; _currScreen = (ScreenBase)projectScreen; projectScreen.PluginManager = _core.PluginManager; lblScreenMessage.Text = _currScreen.TitleMessage(); ((UserControl)_currScreen).Visible = true; _currScreen.Construct(_core.Project); _currScreen.Open(); } }