Solved

Arrays Timer and Graphics

Posted on 2002-05-11
3
173 Views
Last Modified: 2012-05-04
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
0
Comment
Question by:sramkris
  • 2
3 Comments
 

Accepted Solution

by:
ammox2000 earned 100 total points
ID: 7004158
just change the following two procedures:

-----------------------------------------------------------------

Private Sub cmdPlay_Click()

i = 0          'or you can place it in Load event
Timer1.Enabled = True
Timer1.Interval = 10000

End Sub

-----------------------------------------------------------------

Private Sub Timer1_Timer()
Image1.Picture = LoadPicture(disp(i))
Image1.Refresh
i=i+1
if i>9 then Timer1.Enabled = False
End Sub

-----------------------------------------------------------------

you were trying to change images in for loop, actually it should be done in

the timer procedure.thats what i have changed in above procedures.

Amol.
0
 
LVL 1

Author Comment

by:sramkris
ID: 7004982
Thanks Amol for your solution
0
 

Expert Comment

by:ammox2000
ID: 7009469
Thanks for your appreciation.

Amol.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now