Window.ControlCount

From Xojo Documentation

Read-Only Property (As Integer )
IntegerValue = aWindow.ControlCount

Supported for all project types and targets.

The number of controls in the window.

Example

The following example is in the Action event of a PushButton. It displays the number of controls in the Window:

MsgBox(Str(Self.ControlCount))