// Precondition: Attempting to change focus from patron_ComboBox_Validating // Postcondition: If patronBoxCbo.selectedIndex >= 0, focus will change, // else error message will be set private void patron_ComboBox_Validating(object sender, CancelEventArgs e) { if (patron_ComboBox.SelectedIndex < 0) { e.Cancel = true; // Stops focus changing } CheckOutError.SetError(patron_ComboBox, "Must select an patron!"); // Set error message patron_ComboBox.SelectAll(); }
// Precondition: Attempting to change focus from returnItemCbo_Validating // Postcondition: If patronBoxCbo.selectedIndex >= 0, focus will change, // else error message will be set private void patronBoxCbo_Validating(object sender, CancelEventArgs e) { if (patronBoxCbo.SelectedIndex < 0) { e.Cancel = true; // Stops focus changing process } // Will NOT proceed to Validated event CheckOutError.SetError(patronBoxCbo, "Must select an patron!"); // Set error message patronBoxCbo.SelectAll(); }
// Precondition: itemsAvaCbo_Validating Succeeded // Postcondition: ErrorMessage has been cleared, and the user can shift focus and continue on their way private void patronBoxCbo_Validated(object sender, EventArgs e) { CheckOutError.SetError(patronBoxCbo, ""); // Clears error message }
// Precondition: itemsAvaCbo_Validating Succeeded // Postcondition: ErrorMessage has been cleared, and the user can shift focus and continue on their way private void itemsAvaCbo_Validated(object sender, EventArgs e) { CheckOutError.SetError(itemsAvaCbo, ""); // Clears error message }
// Precondition: item_ComboBox_Validated Succeeded // Postcondition: ErrorMessage has been cleared, and the user can shift focus and continue on their way private void item_ComboBox_Validated(object sender, EventArgs e) { CheckOutError.SetError(item_ComboBox, ""); // Clears error message }