我有一个窗体  窗体中有 Picturebox控件   Picturebox中用 command按钮
我用
For i = 1 To 9
        Load Picturebox(i)
        Picturebox(i).ZOrder (0)
        Picturebox(i).Visible = True
        Picturebox(i).Left = Picturebox(i - 1).Left + Picturebox(i).Width + 20
Next i可以动态加载Picturebox控件
但是 我想做的是 在Picturebox控件中还要在加控件要怎么弄呢?
For i = 1 To 9
        Load Picturebox(i)
        Picturebox(i).ZOrder (0)
        Picturebox(i).Visible = True
        Picturebox(i).Left = Picturebox(i - 1).Left + Picturebox(i).Width + 20        for m=1 to 5
          Load command(m)
          command(i).ZOrder (0)
          command(i).Visible = True
          command(i).Left = command(i - 1).Left + command(i).Width + 20
       next m
Next i
控件在控件中

解决方案 »

  1.   

    for m=1 to 5
      Load command(m)
      set command(m).container=picture1
      command(i).ZOrder (0)
      command(i).Visible = True
      command(i).Left = command(i - 1).Left + command(i).Width + 20
      
     next m
      

  2.   

    For i = 1 To 9
      Load PictureBoxtt(i)
      PictureBoxtt(i).ZOrder (0)
      PictureBoxtt(i).Visible = True
      PictureBoxtt(i).Left = PictureBoxtt(i - 1).Left + PictureBoxtt(i).Width + 20        For m = 1 To 5
                Load Command(i)
                Set Command(m).Container = PictureBoxtt(i)
                Command(m).ZOrder (0)
                Command(m).Visible = True
                Command(m).Left = Command(m - 1).Left + Command(m).Width + 20
             Next m
    Next i
      

  3.   

    帮自己顶上去!(我有个新的思路:或者可以在窗体中没有按钮控件的情况下,通过程序创建一组按钮名称循环相加  就比如  创建第一组按钮firstcommand(1)    
    firstcommand(2)
    firstcommand(3)    
    firstcommand(4)secondcommand(1)    
    secondcommand(2)threecommand(1)
    threecommand(2)
    threecommand(3)
    threecommand(4)
    threecommand(5)
    threecommand(6)
    threecommand(7)
      

  4.   

    方法如下,位置自己排去吧。Private Sub Command1_Click()
    For i = 1 To 9
      Load PictureBox(i)
      PictureBox(i).ZOrder (0)
      PictureBox(i).Visible = True
      PictureBox(i).Left = PictureBox(i - 1).Left + PictureBox(i).Width + 20  For m = 1 To 5
      Load Command(Me.Command.Count)
      Command(Me.Command.Count - 1).ZOrder (0)
      Command(Me.Command.Count - 1).Visible = True
      Command(Me.Command.Count - 1).Left = Command(Me.Command.Count - 2).Left + Command(Me.Command.Count - 1).Width + 20
      Next m
    Next iEnd Sub
      

  5.   


    大哥好,您的方法只能在第一PictureBox中创建按钮,那第二的 PictureBox里面是空的我的意思是  循环创建了 3 个PictureBox  然后里面也分别有 几个按钮
      

  6.   

    调整command的位置就行了,这与容器又没有什么关系。