Thanks. This has exposed a genuine gap in the current API. Window.Controls() only returns controls added directly to the window, which is why you see just the TabPanel and GroupBox.
I’ve added the following APIs for the next release: https://feedback.objo.dev/feature/1209
Window.FindControl() and FindControlByTag()
TabPanel.FindControl(), FindControlByTag(), and Controls(tabIndex)
PagePanel.FindControl(), FindControlByTag(), and Controls(panelIndex)
For your database example, you will be able to search the entire window without maintaining a_controls:
For x As Integer = 0 To a_fields.Count - 1
Var control As Control = Self.FindControl(a_fields[x])
If control <> Nothing Then
If control IsA TextField Then
TextField(control).Text = a_values[x]
ElseIf control IsA TextArea Then
TextArea(control).Text = a_values[x]
ElseIf control IsA ComboBox Then
ComboBox(control).Text = a_values[x]
End If
End If
Next
FindControl() searches recursively, including controls inside GroupBoxes, ContainerControls, ScrollBoxes, TabPanels, and PagePanels. Control names are matched case-insensitively.
You will also be able to enumerate the direct controls on an individual tab:
For tabIndex As Integer = 0 To TabPanel1.TabCount - 1
For Each child As Control In TabPanel1.Controls(tabIndex)
If child IsA TextField Or child IsA TextArea Or child IsA ComboBox Then
Print(child.Name)
End If
Next
Next
Until the next release, your explicit a_controls array remains the practical workaround.