23
August
fruit machines
Tommy S asked:


Written a script so that 3 numbers (1,2,3) correspond to the various symbols on a fruit machine (In essense, 111 = You win x amount, 222= You win x amount, 333= you win x amount) How do I go about replacing these numbers with 3 pictures that are randomized? No Idea how to use Pictures in VB6, Any help would be appreciated in the form of simple knowledge or web pages, thanks!

Category : Programming & Design

Comments

Mark G August 26, 2009

Make a collection of images (Lemon,Orange,Cherry) which will correspond to the numbers 1,2&3. Make a new collection object then add the three images to it and assign the number 1,2 or 3 as the “Key”
Do this setup when the form loads so you collection is ready to use.

Your program otherwise remains the same except that when you want to display the results you use the number (1,2 or3) as the index(key) value to extract one of the pictures stored in the collection. The extracted picture is then placed in a pictureBox for display.

Leave a comment