我有一个窗体 窗体中有 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
控件在控件中
我用
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
控件在控件中
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
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
firstcommand(2)
firstcommand(3)
firstcommand(4)secondcommand(1)
secondcommand(2)threecommand(1)
threecommand(2)
threecommand(3)
threecommand(4)
threecommand(5)
threecommand(6)
threecommand(7)
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
大哥好,您的方法只能在第一PictureBox中创建按钮,那第二的 PictureBox里面是空的我的意思是 循环创建了 3 个PictureBox 然后里面也分别有 几个按钮