1 Replies - 1075 Views - Last Post: 21 August 2013 - 09:15 AM Rate Topic: -----

#1 Bhram  Icon User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 43
  • Joined: 17-February 13

imagelist in listview ?

Posted 13 August 2013 - 09:00 AM

hi ,, my application is Import Files from Directory and put in listview with icon files
and is set LargeImageList and SmallImageList to = ImageList1
my code is :

   Try
            Dim path As String = "C:\Program Files (x86)\Clover"
            For Each file In System.IO.Directory.GetFiles(path)
                If file.Contains(".exe") = True Then
                    Dim list As New ListViewItem(IO.Path.GetFileNameWithoutExtension(file))
                    ImageList1.Images.Add(file, Drawing.Icon.ExtractAssociatedIcon(file).ToBitmap)
                    list.ImageKey = file
                    list.SubItems.Add(file)
                    ListView1.Items.Add(list)
                End If
            Next
        Catch ex As Exception

        End Try


It's Work
Posted Image

but the problem is when change view
 ListView1.View = View.LargeIcon


Posted Image

the icon not change size ??

i wanna show icon view large bigger than view Details ??

Is This A Good Question/Topic? 0
  • +

Replies To: imagelist in listview ?

#2 deery5000  Icon User is offline

  • D.I.C Addict

Reputation: 75
  • View blog
  • Posts: 933
  • Joined: 09-May 09

Re: imagelist in listview ?

Posted 21 August 2013 - 09:15 AM

create 2 imagelist, large and small

change the listview to large when you change your view

Have a look here
http://msdn.microsof...eimagelist.aspx
Was This Post Helpful? 2
  • +
  • -

Page 1 of 1