Part | Description | |
object | Required. A valid object. | |
collectionindex | Required. A member's position, or index, within a collection. Numeric as well as string values are acceptable. If the value is a number, the minimum value is zero, and the maximum value is one less than the number of members in the collection. If the value is a string, it must correspond to a valid member name. |
Dim MyTextBox As Control
Private Sub CommandButton1_Click()
Set MyTextBox = MultiPage1.Pages(0).Controls.Add("Forms.TextBox.1", _
"MyTextBox", Visible)
End Sub
Private Sub CommandButton2_Click()
MultiPage1.Pages(0).Controls.Clear
End Sub
Private Sub CommandButton3_Click()
If MultiPage1.Pages(0).Controls.Count > 0 Then
MultiPage1.Pages(0).Controls.Remove "MyTextBox"
End If
End Sub
Private Sub UserForm_Initialize()
CommandButton1.Caption = "Add control"
CommandButton2.Caption = "Clear controls"
CommandButton3.Caption = "Remove control"
End Sub