A better question might be to ask why you need to do this. Usually, when someone is iterating over a window’s controls, there’a an easier way to accomplish what they’re aiming for.
Heh, you missed the point of my post. What are you trying to accomplish? Iterating through the controls is a process; I want to know the goal. That will help us best help you.
i have about 30 objects on my window. some of them with a custom class. this is my actual code:
Dim nome As String
allRequired=True
For Each obj As Object In Self.Controls
Select Case obj
Case IsA alemac_desktopTextField
nome = alemac_desktopTextField(obj).Name // just to debug
If alemac_desktopTextField(obj).required=True Then
If alemac_desktopTextField(obj).Text="" Then
allRequired=False
Return
End If
End If
End Select
Next
why it does not enter the Case IsA alemac_desktopTextField ?
Is your control on a ContainerControl? If so it won’t show. Only controls directly on this window do. Containers don’t show ether, unless you use self.Objects, rather than Self.Controls.