dim Newlistbox as listbox
newlistbox=new listbox
with newlistbox
.xxx=xxxxxx
.xxxx=xxxxx
.
.
.end with
记不大清了,去查一下 MSDN 吧
newlistbox=new listbox
with newlistbox
.xxx=xxxxxx
.xxxx=xxxxx
.
.
.end with
记不大清了,去查一下 MSDN 吧
Private WithEvents btnObj As CommandButtonPrivate Sub btnObj_Click()
MsgBox "This is a dynamically added button."
End SubPrivate Sub Form_Load()
Set btnObj = Controls.Add("VB.CommandButton", "btnObj")
With btnObj
.Visible = True
.Width = 2000
.Caption = "Hello"
.Top = 1000
.Left = 1000
End With
End Sub以上是MSDN中的例子!
http://www.csdn.net/dev/Visual%20Basic/source%20code/Control%20Examples/newctl.zip