private void Form1_Load(object sender, EventArgs e) { //Create list of animals to be slected String[] animals = { "Cow", "Chicken", "Pig", "Guineafowl", "Sheep", "Goat", "Llama", "Alpaca", "Ostrich", "Emu", "Pigeon", "Dog", "Cat" }; List <String> animalsList = new List <string>(animals); listBoxAnimal.DataSource = animalsList; //Create an animal repository animalRepository = new AnimalRepository(); //Setting up dateTimePicker1 with proper format dateTimePicker1.Format = DateTimePickerFormat.Custom; dateTimePicker1.CustomFormat = "MMM d, yyyy"; }
public Form2(AnimalRepository inAnimalRepository) { InitializeComponent(); animalRepository = inAnimalRepository; }