Click here to Skip to main content
15,902,854 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Need Help with Shuffle of a deck Pin
riced10-Apr-09 8:58
riced10-Apr-09 8:58 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan10-Apr-09 8:59
ymilan10-Apr-09 8:59 
GeneralRe: Need Help with Shuffle of a deck Pin
riced10-Apr-09 9:14
riced10-Apr-09 9:14 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan10-Apr-09 9:41
ymilan10-Apr-09 9:41 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan10-Apr-09 9:43
ymilan10-Apr-09 9:43 
GeneralRe: Need Help with Shuffle of a deck Pin
riced10-Apr-09 10:03
riced10-Apr-09 10:03 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan10-Apr-09 10:22
ymilan10-Apr-09 10:22 
GeneralRe: Need Help with Shuffle of a deck Pin
riced10-Apr-09 10:54
riced10-Apr-09 10:54 
Can't believe I made such a blunder D'Oh! | :doh: - but it's because I would normally use a For loop like so (and I'm writing the code in Notepad so no help from the editor Smile | :) ).
For counter = 0 to 100
   ' Get two random image positions
   card1 = Int((52 * Rnd) + 1)
   card2 = Int((52 * Rnd) + 1)

   ' Swap images at these positions
   Set tmpImage      = Image1(card1)
   Set Image1(card1) = Image1(card2)
   Set Image1(card2) = tmpImage
Next counter

Then I don't have to increase counter, the loop does it for me. Note that counter is just counting the numbers of swaps done - it has nothing to do with the number of images it could be set to do 1000 or whatever you like.
All this loop does is shuffle the images. It does not display them in any way - that's down to the Image1(x).Visible = True where x is the number of the image you want to display.
Not sure why it's not displaying. You might try refreshing the the form (i.e add Form.Refresh or a DoEvents after setting Image1(1).Visible = True.

Regards
David R

GeneralRe: Need Help with Shuffle of a deck Pin
ymilan10-Apr-09 10:58
ymilan10-Apr-09 10:58 
GeneralRe: Need Help with Shuffle of a deck Pin
riced10-Apr-09 11:08
riced10-Apr-09 11:08 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan11-Apr-09 6:13
ymilan11-Apr-09 6:13 
GeneralRe: Need Help with Shuffle of a deck Pin
riced12-Apr-09 3:50
riced12-Apr-09 3:50 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan12-Apr-09 5:58
ymilan12-Apr-09 5:58 
GeneralRe: Need Help with Shuffle of a deck Pin
riced12-Apr-09 6:29
riced12-Apr-09 6:29 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan12-Apr-09 6:38
ymilan12-Apr-09 6:38 
GeneralRe: Need Help with Shuffle of a deck Pin
riced12-Apr-09 7:12
riced12-Apr-09 7:12 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan12-Apr-09 7:21
ymilan12-Apr-09 7:21 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan12-Apr-09 8:26
ymilan12-Apr-09 8:26 
GeneralRe: Need Help with Shuffle of a deck Pin
riced13-Apr-09 2:19
riced13-Apr-09 2:19 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan13-Apr-09 14:52
ymilan13-Apr-09 14:52 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan12-Apr-09 6:39
ymilan12-Apr-09 6:39 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan11-Apr-09 8:45
ymilan11-Apr-09 8:45 
AnswerRe: Need Help with Shuffle of a deck Pin
riced10-Apr-09 3:59
riced10-Apr-09 3:59 
GeneralRe: Need Help with Shuffle of a deck Pin
ymilan10-Apr-09 4:54
ymilan10-Apr-09 4:54 
QuestionVisual Studio, VB.Net ODBC Read from Progress Database Pin
RDCK9-Apr-09 8:51
RDCK9-Apr-09 8:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.