Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
6
Reply
masked textbox validation
Dmitrij Solov
Oct 29 2016 3:35 PM
314
Reply
Hello, I used to work on the following subject for 3 days.
I have a masked textbox event:
private
void
button4_Click(
object
sender, EventArgs e)
{
maskedTextBox1.Mask =
"999-000-0000"
;
}
//and the validation of this event:
private
void
button5_Validating(
object
sender, CancelEventArgs e)
{
string
text =
this
.Password
//string value
string
pat = @
"^9994714711"
//code to match
Regex itsme =
new
Regex(pat, RegexOptions.IgnoreCase);
Match itsme2 = itsme.Match(text);
if
(itsme2.Success) { }
else
{
MessageBox.Show(
"Something wrong happend, no match"
,
"Error"
);
e.Cancel =
true
;
}
}
I recieve allways Error-Messages
Can somebody help me?
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
6
)
Next Recommended Forum
How to Soften Edges with Feathering in C# like photoshop
Split an array like below.