Part | Description | |
object | Required. A valid object. | |
Integer | Optional. The index of the currently selected Tab object. |
Dim MyPageOrTab As Object
Private Sub CommandButton1_Click()
'Move third page and tab to front of control
MultiPage1.page3.Index = 0
TabStrip1.Tab3.Index = 0
End Sub
Private Sub CommandButton2_Click()
'Move selected page and tab to back of control
Set MyPageOrObject = MultiPage1.SelectedItem
MsgBox "MultiPage1.SelectedItem = " & MultiPage1.SelectedItem.Name
MyPageOrObject.Index = 4
Set MyPageOrObject = TabStrip1.SelectedItem
MsgBox "TabStrip1.SelectedItem = " & TabStrip1.SelectedItem.Caption
MyPageOrObject.Index = 4
End Sub
Private Sub UserForm_Initialize()
MultiPage1.Width = 200
MultiPage1.Pages.Add
MultiPage1.Pages.Add
MultiPage1.Pages.Add
TabStrip1.Width = 200
TabStrip1.Tabs.Add
TabStrip1.Tabs.Add
TabStrip1.Tabs.Add
CommandButton1.Caption = "Move third page/tab to front"
CommandButton1.Width = 120
CommandButton2.Caption = "Move selected item to back"
CommandButton2.Width = 120
End Sub