//Shows Converter Menu private void ShowConverter() { //Show the converter menu's controls and labels CategoryLabel.Show(); CategoryComboBox.Show(); InstructionLabel.Show(); ValueOfLabel.Show(); UserInputTextBox.Show(); FromLabel.Show(); InitialUnitsComboBox.Show(); ToLabel.Show(); ResultingUnitsComboBox.Show(); BackButtonLabel.Show(); BackButton.Show(); DividerLabel.Show(); UserInputTextBox.Focus(); }
//Overrided method accepting a category parameter obtained from menu selection private void ShowConverter(String category) { //Shows the converter menu's controls and labels CategoryLabel.Show(); CategoryComboBox.Show(); InstructionLabel.Show(); ValueOfLabel.Show(); UserInputTextBox.Show(); FromLabel.Show(); InitialUnitsComboBox.Show(); ToLabel.Show(); ResultingUnitsComboBox.Show(); ConvertSubmissionButton.Show(); BackButtonLabel.Show(); BackButton.Show(); DividerLabel.Show(); //Selects the category field in the converter CategoryComboBox.SelectedIndex = CategoryComboBox.FindStringExact(category); //Shows the default units of measurement ShowDefaultUnits(category); UserInputTextBox.Focus(); }
//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(); }