From Xojo Documentation

Revision as of 18:55, 14 January 2022 by Gperlman (talk | contribs) (Sample Code)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

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
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