我正在尝试从我的资源文件夹中引入一些图像,并且我一直收到错误

时间:2013-10-01 19:26:57

标签: vb.net winforms

Public Class Form1
Private Sub tmrChangeImage_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tmrChangeImage.Tick

    Const intMAXIMAGES As Integer = 5
    Dim imgPictures(intMAXIMAGES - 1) As Image
    Dim intImage As Integer
    imgPictures(1) = My.Resources.ResourceManager.GetObject("flipbook_1_bio")
    imgPictures(2) = My.Resources.ResourceManager.GetObject("flipbook_2_bio")
    imgPictures(3) = My.Resources.ResourceManager.GetObject("flipbook_3_bio")
    imgPictures(4) = My.Resources.ResourceManager.GetObject("flipbook_4_bio")




    PictureBox.Image = Properties.Resources.flipbook__1__bio
    intImage = (intImage + 1) Mod intMAXIMAGES
End Sub
End Class

我的错误就在PictureBox.Image = the line line抛出我之后

1 个答案:

答案 0 :(得分:1)

  1. 您已经两次声明了intMAXIMAGES,一次在Dim语句中,一次在Static语句中。

  2. 您的意思是PictureBox1而不是PictureBox吗?