Im using this code but its not working
private void phone_txt_Validating(object sender, CancelEventArgs e)
{
if (phone_txt.Text.Length == 10)
{
String strcell = String.Empty;
for (int i = 0; i < 10; i++)
{
if (Char.IsDigit(phone_txt.Text[i]))
{
}
else
{
MessageBox.Show("Invalid cellNo");
break;
}
}
//MessageBox.Show("you cell Number is valid:" + phone);
}
else
{
MessageBox.Show("CellNo Should Contain exactly 10 Digits");
}
}