private void Constant_Validating(object sender, CancelEventArgs e) { try { ErrorProvider.SetError(Constant, string.Empty); Constant.CopyStateTo(Item); } catch (Exception) { ErrorProvider.SetError(Constant, "Unable to convert input"); e.Cancel = true; } }