Picture box flash images in folder
I have a folder that will have image files that will change often by one network user and i want to be able to in a picture box flash the contents of this folder. so if there is 5 images in there then i would like to have one up then with a timer it goes to the next one after a certain time. need an idea where to start.
Re: Picture box flash images in folder
Just a newb here but I am trying to do something.
Will the image names be standardized?
like img1 img2 img 24 or will they be random
sun moon flower6 etc etc
Re: Picture box flash images in folder
no thats the problem the names will be different so it needs to be dynamic
Re: Picture box flash images in folder
Use the Dir function to find out what files are in a folder, and the LoadPicture function to load the pictures.
VB's help has good explanations and examples for both.
Re: Picture box flash images in folder
ok thats a good idea to get me started. thanks
Re: Picture box flash images in folder
Another option is to use a hidden FileListBox control. You can set its path & its filter (the Pattern property) to include only VB-supported images (i.e., *.jpg; *.bmp; etc)
Your timer can simply loop thru the listbox.
Code:
Private Sub Timer_Timer()
If File1.ListIndex = File1.ListCount - 1 Then ' on last list item
File1.ListIndex = 0
Else ' move to next list item
File1.ListIndex = File1.ListIndex + 1
End If
End Sub
Now, in your file listbox's Click event, load the picture