mardi 31 mars 2015

Working with arrays of Windows form elements

What I have:



label4.Show();
label5.Show();
pictureBox3.Show();
textBox1.Show();
button3.Show();


What I need (example, but doesn't work):



Object[] arr = new Object[] { label4,label5,pictureBox3,textBox1,button3 };
foreach (Object o in arr)
{
o.Show();
}


Is it to possible to do something like this code?


Aucun commentaire:

Enregistrer un commentaire