/// <summary> /// Throw LostFocus event /// </summary> /// <param name="e"></param> protected virtual void OnLostFocus(LostFocusEventArgs eventArgs) { //Find edited text in combo in list int lSearchItemInCombo = this.mComboBoxIT.FindStringExact(this.mComboBoxIT.Text); string lPreloadErrorMessage = CultureManager.TranslateString(LanguageConstantKeys.L_VALIDATION_PRELOAD_ERROR, LanguageConstantValues.L_VALIDATION_PRELOAD_ERROR); //Locate error message inside combo control this.mErrorProvider.SetIconPadding(this.mComboBoxIT, -35); // Do the validation if (mValidateData) { //Shows errorProvider with new validation message if (lSearchItemInCombo == -1 && !string.IsNullOrEmpty(this.mComboBoxIT.Text)) { mErrorProvider.SetError(this.mComboBoxIT, lPreloadErrorMessage); return; } //Delete any message when combo is empty if (string.IsNullOrEmpty(this.mComboBoxIT.Text)) { //this.Validate(lErrorMessage); mErrorProvider.Clear(); } // Before leaving the control, check if the data belongs to the specified type. string lErrorMessage = CultureManager.TranslateString(LanguageConstantKeys.L_ERROR, LanguageConstantValues.L_ERROR); if ((this.mComboBoxIT.SelectedIndex != -1) && (!this.Validate(lErrorMessage ))) { return; } } if (CheckValueChange(mComboBoxIT.Text)) { // Value changed event OnValueChanged(new ValueChangedEventArgs()); } EventHandler<LostFocusEventArgs> handler = LostFocus; if (handler != null) { handler(this, eventArgs); } }
/// <summary> /// Raise the LostFocus event /// </summary> /// <param name="eventArgs"></param> protected virtual void OnLostFocus(LostFocusEventArgs eventArgs) { EventHandler<LostFocusEventArgs> handler = LostFocus; if (handler != null) { handler(this, eventArgs); } }
/// <summary> /// Handles the Lost Focus event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void HandlePasswordPresenationLostFocus(object sender, LostFocusEventArgs e) { OnLostFocus(e); }