Page 1 of 1

How do you make a Listview similar to Explorer?

Posted: Sun Nov 14, 2010 3:54 am
by 2cool4cereal2
Hello everyone who reads this topic! I was wondering if anyone out there knew how to make a listview box that doubled as something like window's explorer.exe. It would display all of the folders and files in a selected folder and show their icons too. I tried looking online for tutorials for literally hours, but the closet thing I could find was still of absolutely no help. Anyone have any ideas? Below is a picture of kinda what I am looking for.

Image

Re: How do you make a Listview similar to Explorer?

Posted: Sun Nov 14, 2010 3:48 pm
by mandai
I did something like this a few days back in my icon saver program: viewtopic.php?f=38&t=3625&p=25235#p25235

Basically you just have to add an ImageList to the form, then set the LargeImageList/SmallImageList property of the ListView to the ImageList.

To add icons to a listview item you can use the ImageIndex property. Try:
Code: Select all
        Dim img As Image = Image.FromFile("test.png")
        ImageList1.Images.Add(img)

        Dim lvi As ListViewItem = New ListViewItem("text")
        lvi.ImageIndex = 0
        ListView1.Items.Add(lvi)