VB中如何动态添加一个text控件?

来源:百度知道 编辑:UC知道 时间:2024/06/21 23:50:51
VB中如何动态添加一个text控件?

Private Sub Form_Click()
Form1.Controls.Add "VB.TextBox", "text1"
With Form1!text1
.Visible = True
.Width = 1000
.Height = 1000
.Top = 500
.Left = 500
End With
End Sub

'把上面代码放入窗体代码区,运行,然后点击窗体看看