Count Property

Applies To
Form.Controls

Description
Gets the number of controls on a form.

Usage

GGet Form.Controls.Count, var  
Form
Name of a form.
var
Variable that will contain the value of the property.

Values
Returns the number of controls on a form.

Remarks
Use the Count property to determine the number of controls on a form. Then you can iterate through all the controls using the Controls property.

See Also
Controls, Type

Example

Integer count  
  
GSet 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