private void AddButton_Click(object sender, EventArgs e) { string name = NameBox.Text; string description = DescriptionBox.Text; string profession; int lvl; int.TryParse(LevelBox.Text, out lvl); if (ClassCombo.SelectedItem == null) { profession = "Warrior"; } else { profession = ClassCombo.SelectedItem.ToString(); } Character New_Character = new Character(name, lvl, description, profession); CharactersList.Add(New_Character); ComboBind.ResetBindings(false); NameBox.Clear(); LevelBox.Clear(); DescriptionBox.Clear(); ClassCombo.ResetText(); }
private void DeleteButton_Click(object sender, EventArgs e) { CharactersList.RemoveAt(CharactersCombo.SelectedIndex); ComboBind.ResetBindings(false); NameBox.Clear(); LevelBox.Clear(); DescriptionBox.Clear(); ClassCombo.ResetText(); }