-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImage Viewer.vb
More file actions
56 lines (48 loc) · 1.62 KB
/
Image Viewer.vb
File metadata and controls
56 lines (48 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Public Class Image_Viewer
Dim index As Integer
Dim first, last As Integer
Private Sub Image_Viewer_Load(sender As Object, e As EventArgs) Handles MyBase.Load
first = 0
last = ImageList1.Images.Count - 1
Call Button1_Click(sender, e)
End Sub
'previous button
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
If (index <> first) Then
index -= 1
Else
index = last
End If
PictureBox1.Image = ImageList1.Images(index)
End Sub
'next button
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
If (index <> last) Then
index += 1
Else
index = first
End If
PictureBox1.Image = ImageList1.Images(index)
End Sub
'last button
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
index = last
PictureBox1.Image = ImageList1.Images(index)
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Call Button3_Click(sender, e)
End Sub
Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
If (CheckBox1.Checked) Then
Timer1.Interval = 500
Timer1.Enabled = True
Else
Timer1.Enabled = False
End If
End Sub
'First button
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
index = first
PictureBox1.Image = ImageList1.Images(index)
End Sub
End Class