vb.net 如何动态添加picturebox 控件数组(在不知道图片大小的情况下)
1个回答
展开全部
Dim PictureBox11(1) as PictureBox ‘放在最前面
Dim i as integer
Form_load 设i=0
动态添加:
if i>picturebox11.ubound then load(picturebox11(i))
picturebox11(i).loadpicture("图片地址")
Picture11(i).PaintPicture Picture11(i).Picture, 0, 0, Picture11(i).Width, Picture11(i).Height
picturebox11(i).visible=true
i=i+1
动态删除
i=i-1
unload picturebox11(i)
Dim i as integer
Form_load 设i=0
动态添加:
if i>picturebox11.ubound then load(picturebox11(i))
picturebox11(i).loadpicture("图片地址")
Picture11(i).PaintPicture Picture11(i).Picture, 0, 0, Picture11(i).Width, Picture11(i).Height
picturebox11(i).visible=true
i=i+1
动态删除
i=i-1
unload picturebox11(i)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询