点击按钮后在Frame1中新建一个文本框的例子:
Private Sub Command1_Click()Dim txt1 As TextBoxSet txt1 = Me.Controls.Add("VB.TextBox", "txt1")Set txt1.Container = Frame1txt1.Move 360, 360, 3600, 600txt1.Text = "新建的文本框"txt1.Visible = TrueEnd Sub
给你啊一个样子,你自己看。