private void listBoxLists_SelectedIndexChanged(object sender, EventArgs e) { if (listBoxList.Items.Count != 0) { buttonDeleteList.Enabled = true; buttonLoadList.Enabled = true; } labelWordCount.Visible = true; labelWordCount.Text = $"Word count: {WinFormsHelper.Count(listBoxList.GetItemText(listBoxList.SelectedItem))}"; listBoxLanguage.Items.Clear(); foreach (string language in WinFormsHelper.Languages(listBoxList.GetItemText(listBoxList.SelectedItem))) { listBoxLanguage.Items.Add(language.Capitalize()); } listBoxLanguage.SelectedIndex = 0; }