Hi,
Hopefully this is an easy question and there is a simple solution!
Is it possible to programmatically accessing the panels in a windows form?
My form has 5 panels, so if I wanted to loop through the controls in all 5 panels I could, for example, do:
For Each objControl In panel1.Controls
objControl.DoSomething....
Next
For Each objControl In panel2.Controls
objControl.DoSomething....
Next
For Each objControl In panel3.Controls
objControl.DoSomething....
Next
etc, etc for all 5.
Is there anyway I can programmatically set the panel I wish to loop through to save the need to repeat the code for each of the 5 panels as detailed above?
I'm certain it must be possible, and hopefully I'm just missing something obvious!
Thanks in advance,
skip
Hopefully this is an easy question and there is a simple solution!
Is it possible to programmatically accessing the panels in a windows form?
My form has 5 panels, so if I wanted to loop through the controls in all 5 panels I could, for example, do:
For Each objControl In panel1.Controls
objControl.DoSomething....
Next
For Each objControl In panel2.Controls
objControl.DoSomething....
Next
For Each objControl In panel3.Controls
objControl.DoSomething....
Next
etc, etc for all 5.
Is there anyway I can programmatically set the panel I wish to loop through to save the need to repeat the code for each of the 5 panels as detailed above?
I'm certain it must be possible, and hopefully I'm just missing something obvious!
Thanks in advance,
skip