List d'images

quentin0594 Messages postés 12 Date d'inscription vendredi 4 mai 2007 Statut Membre Dernière intervention 23 février 2011 - 19 févr. 2011 à 12:04
quentin0594 Messages postés 12 Date d'inscription vendredi 4 mai 2007 Statut Membre Dernière intervention 23 février 2011 - 22 févr. 2011 à 21:54
Bonjour, j'utilise actuellement ce code pour ajouter toutes les images d'un dossier dans un listview :
    Public Function AnalizeDirectoryframeworkRES()
        Try
                      Dim objFSO, objDossier, objFichier, objResultat
            Dim Directory As String = Application.StartupPath & "\Projects" & My.Settings.CurrentRom & "\Out\system\framework\framework-res\res"
            Dim list As System.Collections.ObjectModel.ReadOnlyCollection(Of String)
            list = My.Computer.FileSystem.GetDirectories(Directory, FileIO.SearchOption.SearchTopLevelOnly)
            Dim path As String
            Dim path2 As String
            'Dim lbmpTemporaire As Icon

            For Each path In list
                path2 = path
                path2 = Mid(path2, Len(Directory) + 1)
                path2 = Microsoft.VisualBasic.Replace(path2, "", "")
                If Left(path2, 8) = "drawable" Then
                    objFSO = CreateObject("Scripting.FileSystemObject")
                    objDossier = objFSO.GetFolder(path)

                    If (objDossier.Files.Count > 0) Then

                        For Each objFichier In objDossier.Files
                            If (InStr(1, objFichier.Name, ".png", 1) > 0) Then
                                SplashScreen1.Update()
                                Dim kkk As ListViewItem = Form1.ListView2.Items.Add(objFichier.Name)
                                kkk.ToolTipText = path
                                ' lbmpTemporaire = path & "" & objFichier.Name
                                'Form1.ImageList1.Images.Add(lbmpTemporaire)

                            End If
                        Next
                    End If
                End If
            Next

            objResultat = Nothing
            objDossier = Nothing
            objFSO = Nothing
                    Catch ex As Exception
            

        End Try
            End Function


Excusez-moi, c'est un peu sale...
Donc vu qu'il s'agit de toutes les images d'un dossier j'aimerais que le list view, à la place des icon affiche l'image.. J'ai beaucoup chercher mais je n'y arrive pas.. Comment faire ?
Peut-être avec un autre composant que un listview ?

Merci d'avance
 

1 réponse

quentin0594 Messages postés 12 Date d'inscription vendredi 4 mai 2007 Statut Membre Dernière intervention 23 février 2011
22 févr. 2011 à 21:54
Ba d'idées ?? :( Je n'y arrive vraiment pas...

 
0
Rejoignez-nous