Hi All,
I'm trying to do a random with pictures in a Imagelist.
Here's the code I'm using:
It's working but after some clicks it gaves me an error:Code:Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click 'Rnd() = 0,9672324 'Rnd() * 10 = 9,672324 'CInt(rnd() * 10) = 10 Dim myNr As Integer myNr = CInt(Rnd() * Me.ImageList1.Images.Count) Me.PictureBox10.Image = Me.ImageList1.Images(myNr) End Sub
Additional information: Specified argument was out of the range of valid values.
What's wrong with this code.
Thanks in advance,
sparrow1





Reply With Quote