Designer Property Example

The following example uses the Designer and Count properties to return the number of controls on a form. Note that the window containing the form must be selected. The Designer object is the form itself.

Debug.Print Application.VBE.SelectVBComponent.Designer.Controls.Count