Why not use the full power of the 'TryParse operator:
using System.Globalization;
CultureInfo cultureProvider = new CultureInfo("en-US");
int rows;
if (Int32.TryParse(txtrows.Text, NumberStyles.Integer, cultureProvider , out rows))
{
}
else
{
throw new ArgumentException("Invalid entry in 'txtrow");
}