Dokumentaro de Gambaso
Compilation & Installation
Components
gb
gb.crypt
gb.qt4
Control
Key
Documents
Indekso de Lingvo
Language Overviews
LeguMin
Lexicon
Registro

ContainerChildren (gb.qt4)

This virtual class returns a virtual collection of all children of a container.

This class is not creatable.

This class acts like a read-only array.

This class is enumerable with the FOR EACH keyword.

Properties
Count   Return the number of child controls.
Max   Return the number of child controls minus one, i.e. the higher child control index.

Methods
Clear   Delete all children controls of a container.

Example

Public Sub Form_Open()

  Dim hChildren As ContainerChildren = FMain.Children
  Dim ob As Object

  Print "FMain has " & Str(hChildren.Count) & " children"

  If hChildren.Count = 0 Then Message.Info("Add some controls (e.g. Button, TextBox etc.) to the FMain form and try again", "OK")

  For Each ob In hChildren
    Print "FMain contains: - " & ob.name
  Next

End

Code adapted from a post by "shell" on the https://www.gambas-es.org web site.