EventArgs used to Validate an InputBox
Inheritance: System.EventArgs
Exemplo n.º 1
0
 /// <summary>
 /// Validate the Text using the Validator
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void textBoxText_Validating(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (Validator != null)
     {
         InputBoxValidatingArgs args = new InputBoxValidatingArgs();
         args.Text = textBoxText.Text;
         Validator(this, args);
         if (args.Cancel)
         {
             e.Cancel = true;
             errorProviderText.SetError(textBoxText, args.Message);
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Validate the Text using the Validator
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void textBoxText_Validating(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (Validator != null)
     {
         InputBoxValidatingArgs args = new InputBoxValidatingArgs();
         args.Text = textBoxText.Text;
         Validator(this, args);
         if (args.Cancel)
         {
             e.Cancel = true;
             errorProviderText.SetError(textBoxText, args.Message);
         }
     }
 }