コード例 #1
0
 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);
     }
 }
コード例 #2
0
 private void textBoxMyName_OnInvalidCharacter(object sender, InvalidCharacterEventArgs data)
 {
     buttonOK.DialogResult = DialogResult.None;
     errorProvider1.SetError(textBoxMyName, data.errMessage);
 }
コード例 #3
0
		/// <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);
		}