how to come out the pic randomly in picture boxes?

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2006
Posts: 6
Reputation: davvid is an unknown quantity at this point 
Solved Threads: 0
davvid davvid is offline Offline
Newbie Poster

how to come out the pic randomly in picture boxes?

 
0
  #1
Nov 26th, 2006
hello,
I wana show the cards in randomly from the array when I click the start button. ex: I have 12 picture boxes. and if click the button , the randomize cards come out to those boxes. How should I do ? :eek:
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 759
Reputation: Killer_Typo will become famous soon enough Killer_Typo will become famous soon enough 
Solved Threads: 35
Killer_Typo's Avatar
Killer_Typo Killer_Typo is offline Offline
Master Poster

Re: how to come out the pic randomly in picture boxes?

 
0
  #2
Dec 3rd, 2006
Originally Posted by davvid View Post
hello,
I wana show the cards in randomly from the array when I click the start button. ex: I have 12 picture boxes. and if click the button , the randomize cards come out to those boxes. How should I do ? :eek:
use the random function, start the seed at 0 and to end at 11.

use the randome->next function, have a function to check to see whether or not the number generated or not has been used, so you would probably want an array that was 12 long (0-11) to store each random number as it was generated.

if the number generated matches a number in the array generate another and check again, if not break out and allow the random image to be placed.

hows that?

i've done it before but with random letters that i generated for a game i wrote.
Dont forget to spread the reputation to those that deserve!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC