コード例 #1
0
ファイル: InputBox.cs プロジェクト: bmxjumperc/ootd
 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);
         }
     }
 }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: bmxjumperc/ootd
 private static void InputBox_Validating(object sender, InputBoxValidatingEventArgs e)
 {
     if (String.IsNullOrEmpty(e.Text.Trim()))
     {
         e.Cancel = true;
         e.Message = "Required";
     }
 }