Thought I'd just add that the TryParse() methods are only available in .NET 2.0 or later.If you're using .NET 1.0 or 1.1, you can replicate it with:int i;
bool isValid = true;
try{ i = Int32.Parse(textBox1.Text);}catch{ isValid = false; i = 0;}