Dim val As Integer, v As String
Const f = 10
Private Sub cmdav_Click()
If val < f Then
val = val + 1
img.Picture = ImageList1.ListImages(val).Picture
Label1.Caption = "Immagine numero : " & val & vbCrLf & "Nome : " & ImageList1.ListImages(val).Key
End If
End Sub
Private Sub cmdcerca_Click()
v = InputBox("Inserisci il numero", "Numero immagine")
If IsNumeric(v) Then
val = Int(v)
If val < f And val > 0 Then
img.Picture = ImageList1.ListImages(val).Picture
Label1.Caption = "Immagine numero : " & val & vbCrLf & "Nome : " & ImageList1.ListImages(val).Key
Else
MsgBox "Elemento non presente", vbInformation, "Non presente"
End If
Else
MsgBox "Input errato", vbCritical, "Errore"
End If
cmdcerca.BackColor = &H8000000F
End Sub
Private Sub cmdcerca_GotFocus()
cmdcerca.BackColor = vbGreen
End Sub
Private Sub cmdcerca_LostFocus()
cmdcerca.BackColor = &H8000000F
End Sub
Private Sub cmdfirst_Click()
img.Picture = ImageList1.ListImages(1).Picture
Label1.Caption = "Immagine numero : 1" & vbCrLf & "Nome : " & ImageList1.ListImages(1).Key
val = 1
End Sub
Private Sub cmdfirst_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
cmdfirst.BackColor = &HFF8080
If X >= cmdfirst.Left And z <= cmdfirst.Width Then
cmdfirst.BackColor = &H8000000F
End If
End Sub
Private Sub cmdind_Click()
If val > 1 Then
val = val - 1
img.Picture = ImageList1.ListImages(val).Picture
Label1.Caption = "Immagine numero : " & val & vbCrLf & "Nome : " & ImageList1.ListImages(val).Key
End If
End Sub
Private Sub cmdind_GotFocus()
cmdind.BackColor = &HFF80FF
End Sub
Private Sub cmdind_LostFocus()
cmdind.BackColor = &H8000000F
End Sub
Private Sub cmdlast_Click()
img.Picture = ImageList1.ListImages(f).Picture
Label1.Caption = "Immagine numero : " & f & vbCrLf & "Nome : " & ImageList1.ListImages(f).Key
val = f
End Sub
Private Sub Form_Load()
val = 1
img.Picture = ImageList1.ListImages(1).Picture
Label1.Caption = "Immagine numero : 1" & vbCrLf & "Nome : " & ImageList1.ListImages(1).Key
Label2.Caption = "Foto totali : " & f
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
cmdfirst.BackColor = &HE0E0E0
End Sub