AddControl Event

Applies To

Frame control, MultiPage control, UserForm object.

Description

Occurs when a control is inserted onto a form, a Frame, or a Page of a MultiPage.

Syntax

For Frame

Private Sub object_AddControl( )

For MultiPage

Private Sub object_AddControl( index As Long, ctrl As Control)

The AddControl event syntax has these parts:

Part

Description

object

Required. A valid object.

index

Required. The index of the Page that will contain the new control.

ctrl

Required. The control to be added.


Remarks

The AddControl event occurs when a control is added at run time. This event is not initiated when you add a control at design time, nor is it initiated when a form is initially loaded and displayed at run time.

The default action of this event is to add a control to the specified form, Frame, or MultiPage.

The Add method initiates the AddControl event.

See Also

Add method.

Example

See the Add method example.