Mike
Mike

Reputation: 2313

Capturing random images

I think everything speaks for itself in the image below. I'm not sure how to write the code to acomplish it.

enter image description here

Upvotes: 0

Views: 452

Answers (1)

Bek Raupov
Bek Raupov

Reputation: 3777

you can store 36 images (or path to iamges) in the collection and when you click on Add button, it chooses random number from 1-36 and load that image to the labels accordingly.

Here are the steps:

  • Store 36 image filepaths in array Array (i.e. 'image1.jpg' and etc)

  • Use Int((36 * Rnd) + 1) to generate random number between 1 and 36 (you will need to run this 3 times)

  • Create Image control (not label, while you can use label to show some text). and then assign Image.Picture properties to the filepath

Upvotes: 1

Related Questions