MultiPage Control
Description
Presents multiple screens of information as a single set.
Remarks
A MultiPage is useful when you work with a large amount of information that can be sorted into several categories. For example, use a MultiPage to display information from an employment application. One page might contain personal information such as name and address; another page might list previous employers; a third page might list references. The MultiPage lets you visually combine related information, while keeping the entire record readily accessible.
New pages are added to the right of the currently selected page rather than adjacent to it.
Note The MultiPage is a container of a Pages collection, each of which contains one or more Page objects.
The default property for a MultiPage is the Value property, which returns the index of the currently active Page in the Pages collection of the MultiPage.
The default event for a MultiPage is the Change event.
Properties
BackColor property, BoundValue property, ControlTipText property, Enabled property, Font object, ForeColor property, Height, Width properties, HelpContextID property, LayoutEffect property, Left, Top properties, MultiRow property, Name property, Object property, OldHeight, OldWidth properties, OldLeft, OldTop properties, Parent property, SelectedItem property, Style property, TabFixedHeight, TabFixedWidth properties, TabIndex property, TabOrientation property, TabStop property, Tag property, Value property, Visible property.
Methods
Move method, SetFocus method, ZOrder method.
Events
AddControl event, BeforeDragOver event, BeforeDropOrPaste event, Change event, Click event, DblClick event, Enter, Exit events, Error event, KeyDown, KeyUp events, KeyPress event, Layout event, MouseDown, MouseUp events, MouseMove event, RemoveControl event, Scroll event, Zoom event.
See Also
Controls collection, Page object, Pages collection.
Example
The following example accesses an individual page of a MultiPage in several ways:
- Using the Pages collection with a numeric index.
- Using the Pages collection with a string index.
- Using the Pages collection with the Item method.
- Using the name of the individual page in the MultiPage.
- Using the SelectedItem property.
To use this example, copy this sample code to the Declarations portion of a form. Make sure that the form contains a MultiPage named MultiPage1.
Private Sub UserForm_Initialize()
Dim PageNAme As String
For i = 0 To MultiPage1.Count - 1
'Use index (numeric or string)
MsgBox "MultiPage1.Pages(i).Caption = " & MultiPage1.Pages(i).Caption
MsgBox "MultiPage1.Pages.Item(i).Caption = " & MultiPage1.Pages _
.Item(i).Caption
PageNAme = MultiPage1.Pages(i).Name
MsgBox "PageName = " & PageNAme
MsgBox "MultiPage1.Pages(PageName).Caption = " & MultiPage1. _
Pages(PageNAme).Caption
MsgBox "MultiPage1.Pages.Item(PageName).Caption = " & MultiPage1. _
Pages.Item(PageNAme).Caption
'Use Page object without referring to Pages collection
If i = 0 Then
MsgBox "MultiPage1.Page1.Caption= " & MultiPage1.Page1.Caption
ElseIf i = 1 Then
MsgBox "MultiPage1.Page2.Caption = " & MultiPage1.Page2.Caption
End If
'Use SelectedItem Property
MultiPage1.Value = i
MsgBox "MultiPage1.SelectedItem.Caption = " & MultiPage1.Selected _
Item.Caption
Next i
End Sub