Ezguy Posted August 7, 2003 Posted August 7, 2003 HI all, I have a array called filepath dim filepath(10000) as string The values in the filepath array is added automatically. filepath(1) = "c:\a.jpg" filepath(2) = "c:\a.jpg" filepath(3) = "c:\a.jpg" filepath(4) = "c:\a.jpg" filepath(5) = "c:\a.jpg" Iam using the timer control to display picture in a picture box. like this Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick P2.Image = System.Drawing.Image.FromFile(filepath(j)) j = j+1 End Sub this is my problem if I make filepath(2) = "false" I don't want the timer to loop through this array index instead it should go to the next index where there is a actual path hope you understand thanks Ezguy Quote www.itfriend.com [ get connected with your IT friends]
*Experts* Volte Posted August 7, 2003 *Experts* Posted August 7, 2003 Try something like this:j += 1 Do Until Not filepath(j) Is Nothing And filepath(j).Length > 0 j += 1 If j > filePath.GetUpperBound(0) Then Return Loop P2.Image = Image.FromFile(filepath(j)) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.