Am writing a Biblical Quiz program where I need to change a picture and midi sound file each time a user advances to a new question.
Have played with several routines but none seem to do what I want.
The following will show the first picture, on click shows the second picture, on the next click shows the third picture. Each click thereafter just rotates between pics 2 and 3. I have 9 pictures that need to be rotated or randomly sellected on each NEXT Question sellection.
This structure should do, but can not figure out how to change Picture2.Picture with either rotating or random method.
Expand|Select|Wrap|Line Numbers
- Private Sub Command1_Click()
- 'Description: Displays a two frame animation using a timer
- 'Place code in timer and set interval as needed
- Static Choice As Integer
- 'Uses 3 picture boxes.
- 'Picture1 - visible display Picture2&3 - pictures
- If Choice Then
- Picture1.Picture = Picture2.Picture
- Else
- Picture1.Picture = Picture3.Picture
- End If
- Choice = Not Choice
- End Sub
Also any URL's for good "Dummy - Dummy's for VB6"
At least I did get one function to work correctly, I have an animated dove that was too lazy to flap his wing when flying across the screen. Of course VB6 doesn't see animated GIF's, so got this one figured out by extracting the 15 individual GIF pictures and using the following routine he does fly across as I want him to do.
Expand|Select|Wrap|Line Numbers
- Option Explicit
- Private Sub Timer3_Timer()
- picAnimate.Top = 1 'set location from top of screen
- 'Static variables keep there value with each procedure call
- Static currentpic As Integer
- 'Determines if the animation is at the last picture and starts
- 'at the beginning if so
- If currentpic = 14 Then currentpic = -1
- 'moves to the next picture
- currentpic = currentpic + 1
- 'moves the picture to the left
- picAnimate.Left = picAnimate.Left + 55 'orig setting 400
- 'determines if image is off screen
- '-3600's causes a slight delay in the animation coming back around
- If (picAnimate.Left) > ScaleWidth Then picAnimate.Left = -1000 ' orig -3600
- 'changes the image to the new image
- picAnimate.Picture = imgDove(currentpic).Picture
- End Sub