I want to have a random picture to be displayed in a picturebox from a list of jpeg files in my debug folder in visual basics.

At the moment i've been using this code to display a specific image but I want the image to be random...

If Label1.Text = "1" Then PictureBox1.Image = Image.FromFile("FILEPATH")

Recommended Answers

What would be an alternative? The prior discussion seems to cover the ways to get a list of files plus advice on how random works (according to Microsoft.)

Jump to Post

All 3 Replies

Thats because I want an alternative method...
Not to be rude but if you're not helping please don't reply...

What would be an alternative? The prior discussion seems to cover the ways to get a list of files plus advice on how random works (according to Microsoft.)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.