In the new version, when I create multiple DesktopContainers and reference them in Windows1.
I hope to enumerate all Container1 objects. In the past, I could use the following code
for each itm as DesktopControl in self.Controls
MessageBox(itm.Name)
next
Because all controls are subclasses of DesktopControl.
But now it seems that something has changed. DesktopContainer is no longer a subclass of DesktopControl. How can I enumerate it?
This worked in older Xojo, does it not work now (with appropriate “desktop” prefixing)?
Public Function ContainerControls(extends w as Window) As ContainerControl()
dim theList() as ContainerControl
dim o as Runtime.ObjectIterator = Runtime.IterateObjects
while o.MoveNext
if o.Current isA ContainerControl and ContainerControl(o.Current).Window is w then
theList.Append ContainerControl(o.Current)
end if
wend
Return theList
End Function