private void textBoxID_TextChanged(object sender, EventArgs e) { int.TryParse(textBoxID.Text, out id); CheckIfFinished(); textBoxID.BackColor = System.Drawing.Color.FromArgb((int)(EventTemplate.EventExists(id) ? 0xFFFF0000 : 0xFFFFFFFF)); }
void CheckIfFinished() { buttonOK.Enabled = ((name != null || name != "") && (id >= 0 && !EventTemplate.EventExists(id)) && color != null); }