Count the controls of container(solved)

Is possible to count ONLY the controls in container?
if i use the bellow count the controls of window

dim i,btns as Integer dim c as Control Dim x,n as string for i=0 to me.ControlCount -1 //<< i have try window1.main (main is the container) the same results c=window.control(i) x=window.control(i).Name if c isa BevelButton then n=n+x +EndOfLine end if next

ContainerControl has ControlCount just like a window.

This works :

for i as integer = 0 to ContainerControl11.ControlCount-1 System.DebugLog ContainerControl11.Control(i).Name next

ContainerControl11 is the instance of ContainerControl1 I dragged over the window.

[quote=264871:@Michel Bujardet]ContainerControl has ControlCount just like a window.

This works :

for i as integer = 0 to ContainerControl11.ControlCount-1 System.DebugLog ContainerControl11.Control(i).Name next

ContainerControl11 is the instance of ContainerControl1 I dragged over the window.[/quote]
Thank you Michel.
One of my mistakes was the c=window.control(i) i changed to self and now all working ok with your answer :wink: