Dim lung As Integer, stringa As String
Private Sub cartelle_Change()
File.Path = cartelle.Path
End Sub
Private Sub cmdadd_Click()
If File.ListIndex <> -1 Then
lung = Len(File.List(File.ListIndex))
stringa = Mid(File.List(File.ListIndex), (lung - 3), lung)
If stringa = ".jpg" Then
List1.AddItem File.List(File.ListIndex)
Command1.Enabled = True
Else
Exit Sub
End If
If List1.List(0) = "Nessun file" Then
List1.Clear
Command1.Enabled = False
End If
End If
End Sub
Private Sub cmddel_Click()
If List1.ListIndex <> -1 And List1.List(0) <> "Nessun file" Then
List1.RemoveItem (ListIndex)
End If
If List1.ListCount = 0 Then
Command1.Enabled = False
End If
End Sub
Private Sub Command1_Click()
frmslide.Show
End Sub
Private Sub Command2_Click()
If List1.ListCount > -1 Then
List1.Clear
Command1.Enabled = False
End If
End Sub
Private Sub Drive1_Change()
On Error GoTo error
cartelle.Path = Drive1.Drive
Exit Sub
error: MsgBox Err.Description, vbCritical, "Errore"
End Sub
Private Sub File_Click()
lung = Len(File.List(File.ListIndex))
stringa = Mid(File.List(File.ListIndex), (lung - 3), lung)
If stringa = ".jpg" Then
imgant.Picture = LoadPicture(cartelle.Path & "\" & File.List(File.ListIndex))
Else
Exit Sub
End If
End Sub
Private Sub File_DblClick()
Call cmdadd_Click
End Sub
Private Sub Form_Load()
cartelle.Path = Drive1.Drive
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload frmset
End Sub
Private Sub List1_Click()
lung = Len(List1.List(List1.ListIndex))
stringa = Mid(List1.List(List1.ListIndex), (lung - 3), lung)
If stringa = ".jpg" Then
imgant.Picture = LoadPicture(cartelle.Path & "\" & List1.List(List1.ListIndex))
Else
Exit Sub
End If
End Sub
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 And List1.ListIndex > -1 And List1.List(0) <> "Nessun file" Then
PopupMenu mnupop
End If
End Sub
Private Sub mnuesci_Click()
Unload frmset
End
End Sub
Private Sub mnurem_Click()
If List1.ListIndex > -1 Then
List1.RemoveItem (List1.ListIndex)
End If
If List1.ListCount = 0 Then
Command1.Enabled = False
End If
End Sub
Private Sub mnuset_Click()
frmset.Visible = True
frmset.Show
End Sub