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?

Amit GuptaRank #190 · 12.8K reputationPosted Oct 31, 2016, 10:17 AM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Oct 31, 2016, 8:49 AM EDT
- string text = this.Password //string value
- string pat = "9994714711" //code to match
if(text ==pat)Amit GuptaRank #190 · 12.8K reputationPosted Oct 29, 2016, 12:17 PM EDT
Ananth GRank #1,176 · 1.5K reputationPosted Oct 30, 2016, 10:16 PM EDT
Dmitrij Solov43 reputationPosted Oct 31, 2016, 8:38 AM EDT
Dmitrij Solov43 reputationPosted Oct 31, 2016, 9:33 AM EDT