H iAll,

Is there a way to loop through all the controls within a container till all the controls are visited?

Something like,
for i = 1 to container.totalcountOfContainedControls
....
....
endfor

Regards

Re: Total count of contained controls by Stefan

Stefan
Sun Jun 20 09:31:43 CDT 2004

Container classes have different names for their "MemberCount"
properties, e.g. Form.ControlCount, Pageframe.PageCount etc.
With that approach, say in a grid, you can
Local i
For i = 1 to This.ColumnCount
? This.Columns(i).Name
EndFor

Alternatively, you can use For Each with the containers' members
collection directly
Local oColumn
For Each oColumn In This.Columns
? oColumn.Name, oColumn.Header1.Caption
Next


hth
-Stefan

"sm" <sm@discussions.microsoft.com> schrieb im Newsbeitrag
news:1FC830F2-756E-4C3B-B618-A9F44CB4E072@microsoft.com...
> H iAll,
>
> Is there a way to loop through all the controls within a container till all the
controls are visited?
>
> Something like,
> for i = 1 to container.totalcountOfContainedControls
> ....
> ....
> endfor
>
> Regards


Re: Total count of contained controls by David

David
Sun Jun 20 12:04:00 CDT 2004

to add to Stefan's reply, you can use the more generic Objects collection
that each container now has:

for each loObject in this.Objects
endfor

--
df - Microsoft MVP FoxPro http://www.geocities.com/df_foxpro

"sm" <sm@discussions.microsoft.com> wrote in message
news:1FC830F2-756E-4C3B-B618-A9F44CB4E072@microsoft.com...
> H iAll,
>
> Is there a way to loop through all the controls within a container till
all the controls are visited?
>
> Something like,
> for i = 1 to container.totalcountOfContainedControls
> ....
> ....
> endfor