private void Form1_Load(object sender, EventArgs e) { SerVivo perro = new Perro("Perro", Image.FromFile("perro.jpg")); miLista.Add(perro); SerVivo gato = new Gato("Gato", Image.FromFile("gato.jpg")); miLista.Add(gato); SerVivo elefant = new Elefante("Elefante", Image.FromFile("elefante.jpg")); miLista.Add(elefant); SerVivo superman = new SuperHeroe("SuperMan", Image.FromFile("superman.jpg"), "TrailerSuperman.avi"); miLista.Add(superman); SerVivo batman = new SuperHeroe("Batman", Image.FromFile("batman.jpg"), "TrailerBatman.avi"); miLista.Add(batman); SerVivo spiderman = new SuperHeroe("Spiderman", Image.FromFile("spiderman.jpg"), "TrailerSpiderman.avi"); miLista.Add(spiderman); SerVivo jhonny = new Actores("Jhonny Depp", Image.FromFile("jhonnydepp.jpg"), "JohnnyDepp.docx"); miLista.Add(jhonny); SerVivo sandra = new Actores("Sandra Bullock", Image.FromFile("sandrabullock.jpg"), "SandraBullock.docx"); miLista.Add(sandra); int i = 0; foreach (SerVivo ani in miLista) { dataGridView1.Rows.Add(); dataGridView1[0, i].Value = ani.Imagen; dataGridView1[1, i].Value = ani.Nombre; dataGridView1[2, i].Value = " Clic Aqui"; i++; } }
private void Form1_Load(object sender, EventArgs e) { Animal perro = new Perro("Perro", Image.FromFile("perro.jpg")); miLista.Add(perro); Animal gato = new Gato("Gato", Image.FromFile("gato.jpg")); miLista.Add(gato); Animal elefant = new Elefante("Elefante", Image.FromFile("elefante.jpg")); miLista.Add(elefant); int i = 0; foreach (Animal ani in miLista) { dataGridView1.Rows.Add(); dataGridView1[0, i].Value = ani.Imagen; dataGridView1[1, i].Value = ani.Nombre; dataGridView1[2, i].Value = " Clic Aqui"; i++; } }