Esempio n. 1
0
 private void StartButton_Click(object sender, EventArgs e)
 {
     if (ValidateCourseLength())
     {
         active = true;
         StartButton.Hide();
         LengthEntryBox.Hide();
         InstructionLabel.Hide();
         myCourse     = new Course(float.Parse(LengthEntryBox.Text, System.Globalization.CultureInfo.InvariantCulture));
         observerList = new List <AthleteObserver>();
         Thread myThread = new Thread(StartSimulation);
         myThread.Start();
         Thread myThread2 = new Thread(RefreshTimer);
         myThread2.Start();
     }
     else
     {
         LengthEntryBox.Clear();
         InstructionLabel.Text = "Must be a number.";
     }
 }
 //Hides Converter Menu
 private void HideConverter()
 {
     CategoryLabel.Hide();
     CategoryComboBox.Hide();
     InstructionLabel.Hide();
     ValueOfLabel.Hide();
     UserInputTextBox.Hide();
     FromLabel.Hide();
     InitialUnitsComboBox.Hide();
     ToLabel.Hide();
     ResultingUnitsComboBox.Hide();
     ConvertSubmissionButton.Hide();
     BackButtonLabel.Hide();
     BackButton.Hide();
     DividerLabel.Hide();
     InitialValueLabel.Hide();
     InitialUnitsLabel.Hide();
     EqualsLabel.Hide();
     ResultingUnitsLabel.Hide();
     ResultingValueLabel.Hide();
     //When navigating back to the main menu its important to clear the field values for the ComboBoxes
     ClearUnitsComboBoxes();
 }