private void AddValue() { InputLanguage currentLanguage = InputLanguage.CurrentInputLanguage; ValueForm vf = new ValueForm(); vf.Text = "Добавить перевод"; if (vf.ShowDialog() == DialogResult.OK) { listBox.Items.Add(vf.Value); } textBox.SelectAll(); InputLanguage.CurrentInputLanguage = currentLanguage; CheckValues(); }
private void EditValue() { InputLanguage currentLanguage = InputLanguage.CurrentInputLanguage; ValueForm vf = new ValueForm(); vf.Text = "Редактировать перевод"; vf.Value = listBox.SelectedItem.ToString(); if (vf.ShowDialog() == DialogResult.OK) { int ndx = listBox.SelectedIndex; listBox.Items.Remove(listBox.SelectedItem); listBox.Items.Insert(ndx, vf.Value); listBox.SetSelected(ndx, true); } textBox.Select(); textBox.SelectAll(); InputLanguage.CurrentInputLanguage = currentLanguage; CheckValues(); }