I was sure that we could do it with the MaskedEdit, but I can't figure out how to build the mask so that it will allow variable quantities of characters in the three sections... and force CharacterCasing to Lower.
Any ideas?
Thanks
I don't think that you can do this with a mask, since you can't build a mask that is variable and dependant on other values. Your best bet is to likely use a simple text editor and validate the input with a regular expression.
-Matt
Have you got a short example of how to wire that up?
Matt Snyder"] I don't think that you can do this with a mask, since you can't build a mask that is variable and dependant on other values. Your best bet is to likely use a simple text editor and validate the input with a regular expression. -Matt
You would first have to describe which type of regular expression that you want to use; there is an article discussion regular expressions here. You would then have to handle the Validating event of the UltraTextEditor (which is an event on the base class Control, so this would work on any editor) and check to see if the regular expression is a match:
private Regex emailRegEx;private Regex EmailRegEx{ get { if (this.emailRegEx == null) this.emailRegEx = new Regex(@"\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b", RegexOptions.IgnoreCase); return this.emailRegEx; }}private void ultraTextEditor1_Validating(object sender, CancelEventArgs e){ if(!this.EmailRegEx.IsMatch(this.ultraTextEditor1.Text)) e.Cancel = true;}
Thanks Matt, that does exactly what we need.