Set Command = Controls.Add("vb.commandbutton", "command1", Pic1(1))command1能不能写成控件数组,如果可以的话,该怎样写呢

解决方案 »

  1.   

    for i=0 to 9
        Set Command1(i) = Controls.Add("vb.commandbutton", "command1" & i, Pic1(1))
      

  2.   

    for i=0 to 9
        Set Command1(i) = Controls.Add("vb.commandbutton", "command1" & i, Pic1(i))
      

  3.   

    http://topic.csdn.net/t/20031118/04/2466781.html
    http://hi.baidu.com/cspcool/blog/item/9b64741799c94010972b439e.html
      

  4.   

    使用全局Collection
    dim Command as new collection '这句放在模块的最顶端For i = 0 To 9
      Command.Add Controls.Add("vb.commandbutton", "command1" & i, Picture1)
      Command(i + 1).Visible = True
    Next
      

  5.   

    谢谢各位的参于,结贴了,我用的方法是用load 然后在 pic1里面先加入一个控件,在动态导入的时候就全部都在pic1里面了