I am writing a simple application in VB.NET to view JPG files. I have a slide show option, and can only get my PictureBox1 to display the last photo. ComboBox1 contains the directory and file information for each file.
Here is my code. Thanks for your help!
Private Sub cmdSlideShow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSlideShow.Click
Dim x As Integer
With ComboBox1
For x = 0 To (.Items.Count) - 1
'display file name on the form
labFile.Text = .Items(x).ToString
PictureBox1.ImageLocation = .Items(x).ToString
'wait for 5 seconds before displaying the next photo
'this seems to work okay, except the photo doesn't display
Threading.Thread.Sleep(TimeSpan.FromSeconds(5).TotalMilliseconds)
Next
End With
End Sub