private void editModeToolStripMenuItem_Click(object sender, EventArgs e) { editModeToolStripMenuItem.Checked = true; practiceModeToolStripMenuItem.Checked = false; TranslationGridView.Show(); AddButton.Show(); RemoveButton.Show(); PracticeButton.Show(); }
private void setActiveWordListToolStripMenuItem_Click(object sender, EventArgs e) { using (SelectWordList selectWordList = new SelectWordList()) { selectWordList.SelectHandler += MyListFormSelectedHandler; selectWordList.ShowDialog(); selectWordList.StartPosition = FormStartPosition.CenterParent; TranslationGridView.Show(); editModeToolStripMenuItem.Checked = true; practiceModeToolStripMenuItem.Checked = false; AddButton.Show(); RemoveButton.Show(); PracticeButton.Show(); } }
private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { if (listBox1.SelectedItem == null) { TranslationGrid.Hide(); InformationBox.Show(); InformationBox.Text = "this is not a valid list"; return; } FileName = listBox1.SelectedItem.ToString(); var wordList = WordList.LoadList(FileName); if (wordList == null) { return; } TranslationGrid.Show(); AddButton.Show(); NewListButton.Show(); RemoveButton.Show(); SaveButton.Show(); PracticeButton.Show(); AddButton.Enabled = true; SaveButton.Enabled = true; RemoveButton.Enabled = true; InformationBox.Hide(); var languageArray = wordList.Languages; var sortBy = 0; CountLabel.Text = $"There are {wordList.Count()} words in the list"; TranslationGrid.Rows.Clear(); TranslationGrid.Columns.Clear(); TranslationGrid.Refresh(); foreach (var languages in languageArray) { TranslationGrid.Columns.Add("newColumnName", languages.ToUpper()); } TranslationGrid.Rows.Clear(); wordList.List(sortBy, x => { TranslationGrid.Rows.Add(x); }); }