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