2个回答
展开全部
'首先将9张图片的名称改为1~9为名字的文件(如:1.jpg~9.jpg)。
'控件数组Picture1(0) 到Picture1(8)
Sub a()
Dim b As New Collection
Dim i As Integer
Dim n As Integer
For i = 1 To 9
b.Add i
Next i
For i = 8 To 0 Step -1
n = Rnd * i + 1
Picture1(i).Picture = LoadPicture(b(n) & ".jpg")
b.Remove n
Next i
End Sub
'控件数组Picture1(0) 到Picture1(8)
Sub a()
Dim b As New Collection
Dim i As Integer
Dim n As Integer
For i = 1 To 9
b.Add i
Next i
For i = 8 To 0 Step -1
n = Rnd * i + 1
Picture1(i).Picture = LoadPicture(b(n) & ".jpg")
b.Remove n
Next i
End Sub
追问
要9张图同时显示,
追答
要添加控件数组Picture1(0) 到Picture1(8),共9个PICTUREBOX中。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询