Hi, I have a small program that displays a number of pictures by using a timer. I don't know if this is the best way to do this, but it works. What I would like to do is add a cmdButton so that every time I hit the cmdSwing button the Timer1_Timer runs displaying the pictures again.
Here's my code (don't laugh). How can I get the cmdSwing to actually initiate the timer section?
Dim inc As Integer
Dim objPics(7) As String
Private Sub cmdSwing_Click()
Timer1.Interval = 50
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
'Dim objPics(7) As String
' Load bitmaps int the Picture object array.
objPics(0) = "C:\Holding\VBstuff\VBA_Lesson_Programs\pic1.bmp"
objPics(1) = "C:\Holding\VBstuff\VBA_Lesson_Programs\pic2.bmp"
objPics(2) = "C:\Holding\VBstuff\VBA_Lesson_Programs\pic3.bmp"
objPics(3) = "C:\Holding\VBstuff\VBA_Lesson_Programs\pic4.bmp"
objPics(4) = "C:\Holding\VBstuff\VBA_Lesson_Programs\pic5.bmp"
objPics(5) = "C:\Holding\VBstuff\VBA_Lesson_Programs\pic6.bmp"
objPics(6) = "C:\Holding\VBstuff\VBA_Lesson_Programs\pic7.bmp"
If inc < 7 Then
pic = objPics(inc)
Picture1.Picture = LoadPicture(pic)
inc = inc + 1
Else
Timer1.Enabled = False
End If
End Sub