private void buttonNewList_Click(object sender, EventArgs e) { FormNewList newList = new FormNewList(this); if (newList.ShowDialog() == DialogResult.OK) { Close(); } }
private void newToolStripMenuItem_Click(object sender, EventArgs e) { FormNewList newList = new FormNewList(this); if (newList.ShowDialog() == DialogResult.OK) { LoadNewList(newList); practiceToolStripMenuItem.Enabled = true; EditButtonsSwitch(); labelCurrentWordList.Text = $"Current list: {newList.SelectedList}"; } }
public void LoadNewList(FormNewList newList) { dataGridViewEdit.Columns.Clear(); dataGridViewEdit.Rows.Clear(); string selection = newList.SelectedList; foreach (string language in WinFormsHelper.Languages(selection)) { dataGridViewEdit.Columns.Add(language, language.ToUpper()); } foreach (string[] words in WinFormsHelper.AllWords(selection)) { dataGridViewEdit.Rows.Add(words); } practiceToolStripMenuItem.Enabled = true; EditButtonsSwitch(); labelCurrentWordList.Text = $"Current list: {newList.SelectedList}"; CurrentList = newList.SelectedList; }