private void NoInvalidCharsTextBox_TextChanged(object sender, EventArgs e) { if (!Valid()) { if (OnInvalidCharacter != null) { InvalidCharacterEventArgs charData = new InvalidCharacterEventArgs(errMessage, position, character); OnInvalidCharacter(this, charData); } } else { if (OnValidCharacter != null) OnValidCharacter(this, null); } }
private void textBoxMyName_OnInvalidCharacter(object sender, InvalidCharacterEventArgs data) { buttonOK.DialogResult = DialogResult.None; errorProvider1.SetError(textBoxMyName, data.errMessage); }
/// <summary> /// The name entered in the policy set name is invalid. In addition to /// setting the local error provider, this informs the parent form of /// the error so that it can maintain a list of all outstanding errors /// </summary> /// <param name="sender"></param> /// <param name="data"></param> private void policySetNameTextBox_OnInvalidCharacter(object sender, InvalidCharacterEventArgs data) { if (m_errorProvider == null) { m_errorProvider = new PolicyDesignerErrorProvider(ParentForm as MDIChildForm, errorProvider1); } m_errorProvider.SetError(policySetNameTextBox, data.errMessage); }