If you set the MaskType and the EditMask, can the editor return a boolean at runtime indicating whether or not it contains a valid value?

          if (myTextEdit.IsValid) { .... }

or perhaps return an enum indicating the following?

           blank
           valid
           invalid
1

There are 1 answers

0
Sebi On

If you set the EditMask, you say what is allowed. So the textedit cant be invalid, because the user just can type values that you declare. The other way is to declare an RegEx at Runtime and test your textEdit input against it, in the validating event of the textEdit. So you can set the Errortext Property of the EventArgs if Match is false. So the user cant leave the textEdit if he type invalid value and he get the hint or error you declare in the e.Errortext Property. Dont forget to set the Errortext Property string.empty in the validated event.

i hope it was helpfull.