sramkris
asked on
Arrays Timer and Graphics
Hi All,
I have a program where i am trying to display a slide show with 10 jpeg files. I have stored them in an array and i have 3 buttons Play pause and stop and also a slider on which to display them accdgly. If i click the play button the slide show should start..The slider should display accdg to the positon in the slider..I have the code written for playing the slide show and the timer interval is fixed at 10000 but the slide show just zips past from 1 to 10 in no time inspite of the timer set at 10000..
Here is the code
Option Explicit
Dim disp(9) As String
Dim path As String
Dim i As Integer
Private Sub cmdPause_Click()
Timer1.Interval = 0
End Sub
Private Sub cmdPlay_Click()
For i = 0 To UBound(disp)
Timer1.Enabled = True
Image1.Refresh
Image1.Picture = LoadPicture(disp(i))
Next i
End Sub
Private Sub cmdStop_Click()
End
End Sub
Private Sub Form_Load()
disp(0) = "C:/UOP/Pictures/pic10.jpg "
disp(1) = "C:/UOP/Pictures/pic2.jpg"
disp(2) = "C:/UOP/Pictures/pic3.jpg"
disp(3) = "C:/UOP/Pictures/pic4.jpg"
disp(4) = "C:/UOP/Pictures/pic5.jpg"
disp(5) = "C:/UOP/Pictures/pic6.jpg"
disp(6) = "C:/UOP/Pictures/pic7.jpg"
disp(7) = "C:/UOP/Pictures/pic8.jpg"
disp(8) = "C:/UOP/Pictures/pic9.jpg"
disp(9) = "C:/UOP/Pictures/pic1.jpg"
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
Timer1.Interval = 10000
End Sub
I am not sure what i did wrong for the slides to go past at past pace..
Any help would be greatly appreciated.
Thanks
Ram
I have a program where i am trying to display a slide show with 10 jpeg files. I have stored them in an array and i have 3 buttons Play pause and stop and also a slider on which to display them accdgly. If i click the play button the slide show should start..The slider should display accdg to the positon in the slider..I have the code written for playing the slide show and the timer interval is fixed at 10000 but the slide show just zips past from 1 to 10 in no time inspite of the timer set at 10000..
Here is the code
Option Explicit
Dim disp(9) As String
Dim path As String
Dim i As Integer
Private Sub cmdPause_Click()
Timer1.Interval = 0
End Sub
Private Sub cmdPlay_Click()
For i = 0 To UBound(disp)
Timer1.Enabled = True
Image1.Refresh
Image1.Picture = LoadPicture(disp(i))
Next i
End Sub
Private Sub cmdStop_Click()
End
End Sub
Private Sub Form_Load()
disp(0) = "C:/UOP/Pictures/pic10.jpg
disp(1) = "C:/UOP/Pictures/pic2.jpg"
disp(2) = "C:/UOP/Pictures/pic3.jpg"
disp(3) = "C:/UOP/Pictures/pic4.jpg"
disp(4) = "C:/UOP/Pictures/pic5.jpg"
disp(5) = "C:/UOP/Pictures/pic6.jpg"
disp(6) = "C:/UOP/Pictures/pic7.jpg"
disp(7) = "C:/UOP/Pictures/pic8.jpg"
disp(8) = "C:/UOP/Pictures/pic9.jpg"
disp(9) = "C:/UOP/Pictures/pic1.jpg"
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
Timer1.Interval = 10000
End Sub
I am not sure what i did wrong for the slides to go past at past pace..
Any help would be greatly appreciated.
Thanks
Ram
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks for your appreciation.
Amol.
Amol.
ASKER