//добавление уровня private void buttonLavelsUseForThisPacient_Click(object sender, EventArgs e) { AddLevel form = new AddLevel("", this); form.ShowDialog(this); if (dRes == DialogResult.OK) { saved = false; buttonLevelsCancel.Enabled = true; buttonLevelsSave.Enabled = true; bufferLevels.Add(new Level(_com)); currentLevel = bufferLevels.Count - 1; UpdateLevelComboBoxList(); comboBoxLevels.SelectedIndex = currentLevel; LevelFillBoxes(); } }
//изменение названия уровня private void button2_Click(object sender, EventArgs e) { if (currentLevel > 2) { AddLevel form = new AddLevel(bufferLevels[currentLevel].Name, this); form.ShowDialog(this); if (dRes == DialogResult.OK) { saved = false; buttonLevelsCancel.Enabled = true; buttonLevelsSave.Enabled = true; bufferLevels[currentLevel].Name = _com; UpdateLevelComboBoxList(); comboBoxLevels.SelectedIndex = currentLevel; } } else MessageBox.Show("Невозможно изменить название стандартного уровня"); }