Hi,
What I guess about your needed validation is :
return true if the text is either blank or numeric string. (i.e. if the text is entered then it should be numeric. Blanks are allowed.)
so in above function once change will be required :
char[] testArr = textBox2.Text.ToArray();
bool stat = false;
for (int i = 0; i < testArr.Length; i++)
{
if (!char.IsNumber(testArr[i]))
{
return false;
}
}
}
return true;