Share via


Add Method (Pages Collection)

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

                 

The Add method adds a new Page object to the Pages collection of a tab control.

Syntax

object**.Add** [before]

The Add method has the following arguments.

Argument Description
object The Pages collection of a tab control.
before An integer that specifies the index of the Page object before which the new Page object should be added. The index of the Page object corresponds to the value of the property for that Page object. If you omit this argument, the new Page object is added to the end of the collection.

Remarks

The first Page object in the Pages collection corresponds to the leftmost page in the tab control and has an index of 0. The second Page object is immediately to the right of the first page and has an index of 1, and so on for all the Page objects in the tab control.

If you specify 0 for the before argument, the new Page object is added before the first Page object in the Pages collection. The new Page object then becomes the first Page object in the collection, with an index of 0.

You can add a Page object to the Pages collection of a tab control only when the form is in Design view.