WebPage.Controls

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
Method

WebPage.Controls() As Iterable

New in 2019r2

Supported for all project types and targets.

Allows you to iterate through the controls on the layout.

Sample Code

This example counts the number of controls on the current page by iterating through them.

Var count As Integer
For Each cntrl As WebUIControl In Self.Controls
count = count + 1
Next
MessageBox("This page has " + count.ToString + " controls.")

This example clears all checkboxes on the page:

For Each cntrl As WebUIControl In Self.Controls
If cntrl IsA WebCheckBox Then WebCheckBox(cntrl).Value = False
Next