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 GuptaPosted Oct 31, 2016, 2:17 PM
Dmitrij SolovPosted Oct 31, 2016, 1:33 PM
Amit GuptaPosted Oct 31, 2016, 12:49 PM
- string text = this.Password //string value
- string pat = "9994714711" //code to match
if(text ==pat)Dmitrij SolovPosted Oct 31, 2016, 12:38 PM
Ananth GPosted Oct 31, 2016, 2:16 AM
Amit GuptaPosted Oct 29, 2016, 4:17 PM