简单方法:
    load  控件名(INDEX)
    初试化控件
    ... (如:设置显示.left.top)
此种方法必须是数组

解决方案 »

  1.   

    我用此法添加command1 怎么不行呢?我想在form1上编程添加一个comand1
    能写一个代码吗?
      

  2.   

    看msdn
    先定义一个集合类型
    再执行集合的添加
    dim collectstring as new collecting
    dim commandx as new command
    collectstring.add commandx
    commandx.show
    仅供参考,详细请看msdn
      

  3.   

    Dim lbl As Control
    Set lbl = frmPoints.Controls.Add("VB.Label", "lblNew", form1)
        lbl.AutoSize = True
        lbl.Caption = "Label控件"
        lbl.Visible = True
        lbl.BackStyle = 0
      

  4.   

    Dim lbl As Control
    Set lbl = Form1.Controls.Add("VB.Label", "lblNew", Form1) 
        lbl.AutoSize = True
        lbl.Caption = "Label控件"
        lbl.Visible = True
        lbl.BackStyle = 0