private void getByOwnerBtn_Click(object sender, EventArgs e) { AnimalslistBox.Items.Clear(); string lastname = OwnerLastNameTxtBox.Text; List <Animal> ListOfAnimalByOwner = myShelter.GetAnimalsByOwner(lastname); if (ListOfAnimalByOwner == null) { AnimalslistBox.Items.Add("There is no animal of this owner!"); } else { foreach (Animal a in ListOfAnimalByOwner) { AnimalslistBox.Items.Add(a); } } }