private void IPoints_TextChanged(object sender, EventArgs e) { try { pointsToWin = Int32.Parse(IPoints.Text); } catch (FormatException ex) { this.Text = "Sorry you must enter a int number"; } }