Home All Groups Group Topic Archive Search About

get all controls collections

Author
5 May 2006 10:54 PM
Jon
Hi, is there a quick way to get ALL the controls within a form?
I mean ALL the controls include all those in a Panel too.
and even those within a few Panels.

basically i have a function to change the control's size and position, i
just want to pass the control in.

I use "For each ctr as control in MyControl"
but that only do me 1 Level of Panel, not those within it.

Any ideas? Thanks

Author
5 May 2006 11:12 PM
Herfried K. Wagner [MVP]
Jon,

"Jon" <J**@discussions.microsoft.com> schrieb:
> I use "For each ctr as control in MyControl"
> but that only do me 1 Level of Panel, not those within it.

Check out the recursive implementation of 'FindControl':

Accessing controls by their names or indices
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=controlbynameindex&lang=en>

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>