Window.Controls

From Xojo Documentation

Method

Window.Controls() As Iterable

New in 2019r2.1

Supported for all project types and targets.

Used to iterate through the controls on a Window.

Notes

All controls on the window are returned as a the Control base type. You can use the IsA operator to check the specific type to see if the control is a PushButton, Label, etc.

Sample Code

Loop through all the controls on a Window and disable only the TextFields:

For Each c As Control In Self.Controls
If c IsA TextField Then
TextField(c).Enabled = False
End If
Next