private void DeleteHandler(object sender, System.EventArgs e) { if (profileListBox.SelectedIndex == -1) return; else { manager.DeleteProfile(profileListBox.SelectedIndex); UpdateUI(); } }