private void btnDeleteList_Click(object sender, EventArgs e) { if (btnDeleteList.BackColor == Variables.enabledColor) { var frm = new frmDelete(false) { StartPosition = FormStartPosition.CenterParent }; frm.ShowDialog(); cbTopic.Items.Remove(frm.Title); UpdateComboBox(); if (Variables.sections.Count > 0) { cbTopic.SelectedIndex = 0; } else { Variables.words = new List <string>(); Variables.titleSection = string.Empty; lbSection.Text = string.Empty; UpdateButtons(); } FillField(true); UpdateLabels(); } }
private void btnDelete_Click(object sender, EventArgs e) { if (btnDelete.BackColor == Variables.enabledColor) { var frm = new frmDelete { StartPosition = FormStartPosition.CenterParent }; frm.ShowDialog(); FillField(true); if (Variables.words.Count == 0) { btnDelete.BackColor = Variables.disabledColor; } } }