Display Images Using Timer

This code will Display Images Using Timer in a Picture Box


Dim counter As Integer
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Timer1.Enabled = True
Timer1.Interval = 1000
If counter > ImageList1.Images.Count - 1 Then
counter = 0
PictureBox1.Image = ImageList1.Images(counter)
counter += 1
Else
PictureBox1.Image = ImageList1.Images(counter)
counter += 1
End If
End Sub


Attachments

  • Download Sample From Here (20784-81522-Display Images Using Timer.rar)
  • Comments

    Guest Author: PrakashKaur18 Apr 2013

    wow it is great Thanks to share it.

    Author: Phagu Mahato11 Oct 2013 Member Level: Gold   Points : 0

    You need to set timer 1 dalay according to need .If your want to display only four images initially in the following order with a timer delay
    Private Sub Timer1_Timer()
    ' play sound
    z = PlaySound(App.Path & "/sounds/example.wav", 0)
    ' see if image is not visible, make visible
    If Not Image1.Visible Then
    Image1.Visible = True
    ElseIf Not Image2.Visible Then
    Image2.Visible = True
    ElseIf Not Image2.Visible Then
    Image3.Visible = True
    ElseIf Not Image4.Visible Then
    Image4.visible = True
    Else
    ' hide so we have kind of a loop
    Image1.Visible = False
    Image2.Visible = False
    Image3.Visible = False
    Image4.Visible = False
    End If
    End Sub
    Useful referance
    http://msdn.microsoft.com/en-us/library/ms172590%28v=vs.90%29.aspx



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: