Handle Multiple Controls with index
Hi,
I've been searching all day about this and found more or less...
I have to handle a bunch of Controls (labels and listboxes) about 20-30 of them each.
I don't want to program every one of them with individual code.
for example:
label[1].Location = new Location(x1,y1)
listbox[1].Location = new Location(x2,y2);
...
Thank you!
Fox
Matt SpellerPosted Oct 11, 2005, 6:58 AM
private void SomeMethod()
{
foreach(System.Windows.Forms.Control c1 in this.Controls)/*Where this.Controls can be replaced with this.panel1.Controls if in a panel
if(c1 is System.Windows.Forms.Label)or form1Instance.Controls is calling outside a form instance....
*/
{
{
}
}
}