Originally posted by fill0botto95
Dim images() As Image
Dim rand As Random
picturebox1.Backgroundimage= image(rand.next(0, images.lenght-1))
Thanks for the reply i copied this piece of code into mine to see if it would work but yet im still getting errors,
i get the error lenght is not a member of system array
This is the code which i created myself doesnt work either
' Method for doing Random
Dim random As New Random
' Image Array
Dim imgPictures(3) As Image
imgPictures(0) = My.Resources.Red
imgPictures(1) = My.Resources.Blue
imgPictures(2) = My.Resources.Black
imgPictures(3) = My.Resources.Yellow
' Trying to randomise the images within the Picturebox - THE PROBLEM
Dim imgReel1 As Integer = random.Next(0, imgPictures.Images.Count)
PicBox1.Image = imgPictures.Images(imgReel1)
Dim imgReel2 As Integer = random.Next(0, imgPictures.Images.Count)
Picbox2.Image = imgPictures.Images(imgReel2)