VBa : 多个图片框上的多个图片
VBa : multiple pictures on multiple picturebox
嗨,它是一个目录应用程序
我的文件夹中有 50 张图片,但我想在应用程序加载中显示 12 个图片框中的 12 张图片
我使用此代码,但它什么也没给我
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim pic As PictureBox
For i = 0 To 12
pic = Me.Controls("picturebox" & i)
pic.Image = Image.FromFile("C:\Dev\Images\TEST400.jpg")
Next i
End Sub
请帮忙
您的图像文件应保存为TEST1.jpg、TEST2.jpg、......TEST12.jpg等
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim pic As PictureBox
For i = 1 To 12
pic = Me.Controls("picturebox" & i)
pic.Image = Image.FromFile(@"C:\Dev\Images\TEST" + i.ToString +".jpg")
Next i
End Sub
注意:我只是在这里写了这段代码。未测试。
嗨,它是一个目录应用程序 我的文件夹中有 50 张图片,但我想在应用程序加载中显示 12 个图片框中的 12 张图片 我使用此代码,但它什么也没给我
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim pic As PictureBox
For i = 0 To 12
pic = Me.Controls("picturebox" & i)
pic.Image = Image.FromFile("C:\Dev\Images\TEST400.jpg")
Next i
End Sub
请帮忙
您的图像文件应保存为TEST1.jpg、TEST2.jpg、......TEST12.jpg等
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim pic As PictureBox
For i = 1 To 12
pic = Me.Controls("picturebox" & i)
pic.Image = Image.FromFile(@"C:\Dev\Images\TEST" + i.ToString +".jpg")
Next i
End Sub
注意:我只是在这里写了这段代码。未测试。