|
-
December 20th, 1999, 02:54 PM
#1
Randomly display .bmp files from a particular directory
Does anyone have a quick, easy, and memory efficient way of looping through a specific directory to randomly display an image file in a picture box control (all files in this particular directory are .bmp files)? The random display would occur each time they click a command button. The only part I'm stuck on is making the image selection random.
I'm using VB5 in a 95 & NT environment.
Much thanks in advance!
-
December 21st, 1999, 02:25 AM
#2
Re: Randomly display .bmp files from a particular directory
Try to save all the file names into String() array, and randomly get index of each element of this array,
something like this:
Randomize
i = Rnd(...)
Picture1.Picture = LoadPicture(Files(i))
Good Luck!
-
December 23rd, 1999, 11:54 AM
#3
Re: Randomly display .bmp files from a particular directory
THANK YOU! THANK YOU! THANK YOU!
I tried to rate your message as Excellent, but I am not registered (maybe I'll get around to it one of these days).
Again, I thank you very much for taking the time to help me out!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|