Controls Property
Applies To
Form
Description
Array of controls in the form. Used to access control properties with an index.
Usage
GGet Form.Controls(Index As Integer).Property, var
GSet Form. Controls(Index As Integer).Property, value
- Form
- Name of a form.
- Index
- Integer expression containing the index of a control on the form.
- Property
- Name of the control property to access.
- var
- Variable that will contain the value of the property. The data type depends on which property is specified.
- value
- Expression for the new value of the property. The data type depends on which property is specified.
Remarks
Use the Controls property to access controls on the form using an index. This allows you to iterate through the control collection and get or set common properties.
See Also
Count, Type
Example
Integer i, count
String type$
GGet frmMain.Controls.Count, count
For i = 1 To count
GGet frmMain.Controls(i).Type, type$
If type$ = "Button" Then
GSet frmMain.Controls(i).Enabled, False
EndIf
Next i