|
-
Jun 18th, 2004, 10:07 PM
#1
Thread Starter
Lively Member
PictureBox Timer [Resolved]
Is there an easy way to loop the seconds/miliseconds that a picturebox will display a picture before hiding it again and showing the next PictureBox in sequence?
I haven't had any good results out of this at all.
Code:
PictureBox7.Visible = True
System.Threading.Thread.Sleep(1000)
PictureBox7.Visible = False
System.Threading.Thread.Sleep(1000)
PictureBox9.Visible = True
System.Threading.Thread.Sleep(1000)
PictureBox9.Visible = False
System.Threading.Thread.Sleep(1000)
PictureBox11.Visible = True
System.Threading.Thread.Sleep(1000)
PictureBox11.Visible = False
System.Threading.Thread.Sleep(1000)
PictureBox13.Visible = True
System.Threading.Thread.Sleep(1000)
PictureBox13.Visible = False
System.Threading.Thread.Sleep(1000)
PictureBox15.Visible = True
System.Threading.Thread.Sleep(1000)
PictureBox15.Visible = False
System.Threading.Thread.Sleep(1000)
PictureBox17.Visible = True
System.Threading.Thread.Sleep(1000)
PictureBox17.Visible = False
Last edited by teamdad; Jun 22nd, 2004 at 05:55 PM.
-
Jun 18th, 2004, 10:23 PM
#2
Sleep mode
How about this ?
VB Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Me.PictureBox1.Visible Then
Me.PictureBox1.Visible = False
Else
Me.PictureBox1.Visible = True
End If
End Sub
-
Jun 18th, 2004, 11:38 PM
#3
Thread Starter
Lively Member
I think I should have put all the code in for what i'm trying to do.
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
PictureBox1.Visible = True
PictureBox2.Visible = False
PictureBox3.Visible = False
PictureBox4.Visible = False
End Sub
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
Win32.WinMM.PlayWavResource("mojo.wav")
System.Threading.Thread.Sleep(1000)
Me.PictureBox1.Visible = False
System.Threading.Thread.Sleep(1000)
Me.PictureBox2.Visible = True
System.Threading.Thread.Sleep(1000)
Me.PictureBox2.Visible = False
Me.PictureBox3.Visible = True
System.Threading.Thread.Sleep(1000)
Me.PictureBox3.Visible = False
Me.PictureBox4.Visible = True
System.Threading.Thread.Sleep(1000)
Me.PictureBox4.Visible = False
End Sub
The form loads with all picture boxes visible = False except for number 1.
You click on picture box 1 and it starts playing the wav file, it waits a second and hides picture box 1, it then shows picture box 2, waits a second and hises it, then it shows picture box 3, waits a second and then hides it, it shows picture box 4, waits a second and then hides it. By this time the wav file has finished and has stoped playing.
Lining the picture boxes up side by side and running the program will show the picture in each box advance each second one at a time till it gets to the end.
-
Jun 19th, 2004, 09:02 AM
#4
Thread Starter
Lively Member
Keeping this alive and hoping for an answer or a pointer.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|