private void btnResults_Click(object sender, EventArgs e) { ResultsForm results = new ResultsForm(); DialogResult res = results.ShowDialog(); switch (res) { case DialogResult.OK: break; case DialogResult.Cancel: break; } }
private void betweenRaces_Tick(object sender, EventArgs e) { if (abortRace) { abortRace = false; offWeGo.Text = "Race Aborted - Resetting..."; //btnGO.Enabled = true; btnPrev.Enabled = true; btnReRun.Enabled = true; betweenRaces.Enabled = false; btnGO.Enabled = true; //raceList = prevRaceList; fillRaceDetails(raceList); } else { //btnGO.Enabled = true; btnPrev.Enabled = true; btnReRun.Enabled = true; betweenRaces.Enabled = false; // // Get details of the next race & reload the screen if (raceStart) { raceList = people.getFirstRaceDetails(raceClass); raceStart = false; } else { prevRaceList = raceList; raceList = people.getNextRaceDetails(); } if (raceList.IndexOf('|') > 0) { fillRaceDetails(raceList); } else { // // Now show up the results screen ResultsForm results = new ResultsForm(); try { string[] details = raceClass.Split(sep); results.setClass(int.Parse(details[0])); } catch { results.setClass(1); } DialogResult res = results.ShowDialog(); switch (res) { case DialogResult.OK: break; case DialogResult.Cancel: break; } // // when we get back - continue raceClass = people.getNextClass(); try { string[] details = raceClass.Split(sep); offWeGo.Text = "Next Class: " + details[1]; raceStart = true; betweenRaces.Enabled = true; r1Name.Text = ""; r2Name.Text = " Here goes with the next race..."; r3Name.Text = ""; r1Car.Text = ""; r2Car.Text = ""; r3Car.Text = ""; r1Time.Text = ""; r2Time.Text = ""; r3Time.Text = ""; r1Position.Text = ""; r2Position.Text = ""; r3Position.Text = ""; } catch { offWeGo.Text = "Racing completed in all classes"; raceStart = true; btnGO.Enabled = false; r1Name.Text = "Thank you for coming!"; r2Name.Text = "We hope you enjoyed it..."; r3Name.Text = ""; r1Car.Text = ""; r2Car.Text = ""; r3Car.Text = ""; r1Time.Text = ""; r2Time.Text = ""; r3Time.Text = ""; r1Position.Text = ""; r2Position.Text = ""; r3Position.Text = ""; } //Refresh(); //Thread.Sleep(betweenRaces.Interval); //raceList = people.getFirstRaceDetails(raceClass); //if (raceList.IndexOf('|') > 0) //{ // fillRaceDetails(raceList); //} //else //{ // offWeGo.Text = "Racing completed in all classes"; //} } if (!raceStart) btnGO.Enabled = true; } }