如何动态增减控件(已解决)
如何实现像QQ一样添加删除好友后动态增减控件的功能[此贴子已经被作者于2007-2-27 16:26:40编辑过]
终于找到了,可以用CONTROL属性的ADD和REMOVE方法
Dim OBJ As Object
Set OBJ = Controls.Add("VB.commandbutton", "button1", Frame1) '在FRAME1控件中增加控件
With OBJ
.Left = 0
.Top = 0
.Visible = True
End With
Set OBJ = Controls.Add("VB.commandbutton", "button2",Form1) '在FORM1中增加控件
With OBJ
.Left = 0
.Top = 0
.Visible = True
End With
End Sub