Dim MyTextBox As Control
Private Sub CommandButton1_Click() [U] Set MyTextBox = MultiPage1.Pages(0).Controls.Add("MSForms" & ".TextBox.1", "MyTextBox", Visible)[/U]
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
在黑体下划线行提示“运行时错误'2147221005 (800401f3)':无效的类别字符串”,不知该如何处理?请版主帮助。
|