Пример #1
0
 private static void InputBox_Validating(object sender, InputBoxValidatingEventArgs e)
 {
     if (string.IsNullOrEmpty(e.Text.Trim()))
     {
         e.Cancel  = true;
         e.Message = "Required";
     }
 }
Пример #2
0
 private static void InputBox_Validating(object?sender, InputBoxValidatingEventArgs e)
 {
     if (string.IsNullOrWhiteSpace(e.Text))
     {
         e.Cancel  = true;
         e.Message = "Required";
     }
 }
Пример #3
0
 private void InputTextBox_Validating(object sender, CancelEventArgs e)
 {
     if (Validator != null)
     {
         var args = new InputBoxValidatingEventArgs { Text = InputTextBox.Text };
         Validator(this, args);
         if (args.Cancel)
         {
             e.Cancel = true;
             _errorProviderText.SetError(InputTextBox, args.Message);
         }
     }
 }
Пример #4
0
 private void InputTextBox_Validating(object sender, CancelEventArgs e)
 {
     if (Validator != null)
     {
         var args = new InputBoxValidatingEventArgs {
             Text = InputTextBox.Text
         };
         Validator(this, args);
         if (args.Cancel)
         {
             e.Cancel = true;
             _errorProviderText.SetError(InputTextBox, args.Message);
         }
     }
 }
Пример #5
0
 private static void InputBox_Validating(object sender, InputBoxValidatingEventArgs e)
 {
     if (string.IsNullOrEmpty(e.Text.Trim()))
     {
         e.Cancel = true;
         e.Message = "Required";
     }
 }