private void butDelete_Click(object sender, EventArgs e) { if (listOther.SelectedIndex == -1) { MsgBox.Show(this, "Please select a phone number first."); return; } PhoneNumbers.DeleteObject(otherList[listOther.SelectedIndex].PhoneNumberNum); FillList(); }