Hi people
I am creating basic slideshow form to finish off an app I am writing. I have been at it all day finishing off the main app and am getting very tired now!!
Anyway, I have a form (which is called by another form) with just a Picturebox and a Timer on it. I use the following code to read in all the images in a folder:
I want to be able to display them in the Picturebox on the same form at an interval of around 1 every 5 seconds. I have thought about using a Timer and using the Timer1_tick event to trigger the picture change but how can I go about this? I cannot have the following:Code:Public Function GetPics() Dim pic() As String = Directory.GetFiles(strPicSource) For i As Integer = 0 To UBound(pic) picPath = pic(i) 'MsgBox(pic(i)) Next End Function
As this just points to the array of images and not a single image and there is no way of telling it to move to the next image each time.Code:Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick 'PictureBox1.ImageLocation = pic() End Sub
Can anyone help me out here?
Thanks in advance![]()




Reply With Quote