(Solved) – messagebox popping up twice (regex)


so here is my problem, so when I type in a digit into the txtFullNameAdminAddPatientTextbox , it pops up a messagebox showing “please only enter digit. But the problem is, why does it pop up the messagebox TWICE? thanks in advance

If (Not (System.Text.RegularExpressions.Regex.IsMatch(txtFullNameAdminAddPatientPage.Text, “^[a-zA-Zs] $”))) Then
txtFullNameAdminAddPatientPage.Text = “”
MessageBox.Show(“Please only enter digit.”)
End If

Leave a Reply

Your email address will not be published. Required fields are marked *