Michael Howard_1
04.05.2006
Hi Michael,
You can create a default MaskManager that provides mask functionality according to the current mask type and verify whether the assigned value is valid (see the code below):
private void simpleButton1_Click(object sender, System.EventArgs e) {
string testedText = "sample text";
MaskManager mm = textEdit1.Properties.Mask.CreateDefaultMaskManager();
mm.SetInitialEditText(testedText);
if(testedText != mm.GetCurrentEditText() || !mm.IsMatch) {
// Do some stuff.
MessageBox.Show("Invalid value", "Error");
}
else {
textEdit1.Text = testedText;
}
}