(Q) (SOS) problem with listview imagelist like windows explorer

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#fafafa how create photo album, i wonder to create like windows explorer with thumbnail folder (as category) when
i perform click the show all my picture inside folder and show the name without extension just filename, i just try it with listview.. can anyone help me to figure this out..
<img alt="" src="http://social.msdn.microsoft.com/Forums/getfile/217427
im using vb.net 2010
here my code to display directory, and the directory loaded but the thumbnail not show up;
<pre class="prettyprint lang-vb For Each i As String In IO.Directory.GetDirectories("d:")

ListView3.Items.Add(Path.GetFileName(i)) the Path is a separate class of the System.IO Namespace that allows you to perform operations based on path information - such as GetFileName
Next
ImageList1 = New ImageList()
ListView3.Items(0).ImageIndex = 2
ListView3.View = View.LargeIcon
ImageList1.ImageSize = New Size(250, 250)
For Each g As String In IO.Directory.GetFiles("d:")
Dim i As Image = Image.FromFile(g.ToString())
Dim img As Image = i.GetThumbnailImage(300, 300, Nothing, Nothing)
ImageList1.Images.Add(img)
img.Dispose()
GC.Collect()
Next
ListView3.LargeImageList = ImageList1
For j As Integer = 0 To ImageList1.Images.Count - 1
Dim lstItem As New ListViewItem()
lstItem.ImageIndex = j
ListView3.Items.Add(lstItem)
Next[/code]
and how to create the directory double click show the insert files in the directory and opened in the same listview3
just*jpeg to load
just like windows explorer (win xp; so just one random image as thumbnail view), my image attachment on the top, im using win7 to create the sample screen shot
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#fafafa and the folder directory start with c:photo will load all directory sub folder ex:<br style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#fafafa
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#fafafa c:photovacation <-- when thumbnail click will load all image in vacation folder<br style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#fafafa
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#fafafa c:photoholiday<br style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#fafafa
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#fafafa c:photonews <br style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#fafafa
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#fafafa and etc
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#fafafa
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#fafafa hope someone give me some sample code or advice to do that..
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#fafafa
<span style="color:#333333; font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size:13px; line-height:normal; background-color:#fafafa thanks for your kindly to read my thread




View the full article
 
Back
Top