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
Dim MyTextBox As Control
Private Sub CommandButton1_Click()
Set MyTextBox = MultiPage1.Pages(MultiPage1.Value).Controls.Add( _
"Forms.TextBox.1", "MyTextBox", Visible)
CommandButton2.Enabled = True
CommandButton1.Enabled = False
End Sub
Private Sub CommandButton2_Click()
MultiPage1.Pages(MultiPage1.Value).Controls.Cut
CommandButton3.Enabled = True
CommandButton2.Enabled = False
End Sub
Private Sub CommandButton3_Click()
Dim MyPage As Object
Set MyPage = MultiPage1.Pages.Item(MultiPage1.Value)
MyPage.Paste
CommandButton3.Enabled = False
End Sub
Private Sub UserForm_Initialize()
CommandButton1.Caption = "Add"
CommandButton2.Caption = "Cut"
CommandButton3.Caption = "Paste"
CommandButton1.Enabled = True
CommandButton2.Enabled = False
CommandButton3.Enabled = False
End Sub