vb如何动态创建一个textbox和撤销一个textbox
已有textbox,如何动态创建更多的textbox和撤销(不是隐藏)这些textbox(撤销后遍历应该找不到。)。...
已有textbox,如何动态创建更多的textbox和撤销(不是隐藏)这些textbox(撤销后遍历应该找不到。)。
展开
展开全部
Option Explicit
Dim x As Control
Private Sub Command1_Click()
'动态创建textbox
Set x = Me.Controls.Add("VB.textbox", "text", Me)
With x
.Width = 1000
.Height = 500
.Visible = True
.Left = 200
.Top = 100
End With
End Sub
Private Sub Command2_Click()
on error resume next
Me.Controls.Remove x '删除创建的textbox
End Sub
Dim x As Control
Private Sub Command1_Click()
'动态创建textbox
Set x = Me.Controls.Add("VB.textbox", "text", Me)
With x
.Width = 1000
.Height = 500
.Visible = True
.Left = 200
.Top = 100
End With
End Sub
Private Sub Command2_Click()
on error resume next
Me.Controls.Remove x '删除创建的textbox
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询