void listBox_SelectedIndexChanged(object sender, EventArgs e) { ListBox listBox = (ListBox)sender; TournamentCreatorForm tcf = new TournamentCreatorForm((int)listBox.SelectedItem); tcf.Show(); if (!listBox.IsDisposed) { listBox.Dispose(); } this.Close(); }
private void openExistingTourButton_Click(object sender, EventArgs e) { using (OpenFileDialog fileDialog = new OpenFileDialog()) { fileDialog.Title = "Select a tournament"; fileDialog.Filter = "Tournament Files|*.tmst"; if (fileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { TournamentCreatorForm tcf = new TournamentCreatorForm(); tcf.LoadTournament(fileDialog.FileName); tcf.Show(); this.Close(); } } }