Dim num, time As Integer
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
Dim show As Integer
If Timer1.Enabled Then
show = MsgBox("还看照片吗?", MsgBoxStyle.YesNo + MsgBoxStyle.Information + MsgBoxStyle.DefaultButton1, "选择")
If show = MsgBoxResult.Yes Then
Timer1.Stop()
End If
Else
Timer1.Start()
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
PictureBox1.Image = ImageList1.Images(num)
num = (num + 1) Mod time
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
num = ImageList1.Images.Count
time = 0
End Sub