DesktopWindow.Controls

From Xojo Documentation

Method

DesktopWindow.Controls() As Iterable

New in 2021r3

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 DesktopControl base type. You can use the IsA operator to check the specific type to see if the control is a button, label, etc.

Sample Code

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

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