5 pts.
 Vb.Net Image List
I am Trying to build a game that uses arrays to select an image from an image list. when i run the game, i get an image in the image box, but it keeps cycling through all three options. the code so far is: Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim flagRight As Integer = 0 Dim flagLeft As Integer = 0 Dim I, J As Integer Do Until flagRight = 1 I = Int(Rnd() * 3) picRight.Image = imlRight.Images(I) flagRight = 1 Loop Do Until flagLeft = 1 J = Int(Rnd() * 3) picLeft.Image = imlLeft.Images(J) picRight.Visible = True flagLeft = 1 Loop Can anyone help thanks a lot

Software/Hardware used:
ASKED: May 30, 2008  11:53 PM
UPDATED: July 13, 2008  7:51 AM

Answer Wiki:
The value of FlagRight and FlagLeft is being reset on each Timer Tick with Dim flagRight As Integer = 0 inside the event handler., which is why your attempt to set its value to 1 as a means of stopping it fails. I am not exactly sure what it is that you want to do though. If you want to post up more of an explanation of the steps you want to happen it would be easier to show you the appropriate code. (Just something along the lines of "User clicks button - Timer is enabled, Random images are shown, when user does <whatever> images change ... etc)
Last Wiki Answer Submitted:  July 13, 2008  7:51 am  by  Xtab   15 pts.
All Answer Wiki Contributors:  Xtab   15 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _