Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • *Experts*
Posted
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))

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...