private void txtname_TextChanged(object sender, EventArgs e)
{
if (!System.Text.RegularExpressions.Regex.IsMatch(txtname.Text, "^[a-zA-Z]"))
{
MessageBox.Show("This textbox accepts only alphabetical characters");
txtname.Text = "";
}
}
{
if (!System.Text.RegularExpressions.Regex.IsMatch(txtname.Text, "^[a-zA-Z]"))
{
MessageBox.Show("This textbox accepts only alphabetical characters");
txtname.Text = "";
}
}
No comments:
Post a Comment