How do you make a Listview similar to Explorer?

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
2 posts Page 1 of 1
Contributors
User avatar
2cool4cereal2
VIP - Donator
VIP - Donator
Posts: 151
Joined: Thu Oct 14, 2010 3:26 am

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
"I try to be modest at all times, and that's what makes me better than everyone else."
Image
Image
Image
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

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)
2 posts Page 1 of 1
Return to “Tutorial Requests”