dim Newlistbox as listbox
newlistbox=new listbox
with newlistbox
  .xxx=xxxxxx
  .xxxx=xxxxx
  .
  .
  .end with
    记不大清了,去查一下 MSDN   吧

解决方案 »

  1.   

    谢谢gameboy999,只是如何相应listbox的事件呢?
      

  2.   

    Option Explicit
    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中的例子!
      

  3.   

    请看一下这个例子:
    http://www.csdn.net/dev/Visual%20Basic/source%20code/Control%20Examples/newctl.zip