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

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.