Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 0f7b4b21 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

file browser: correct error showing icon of parent folder in folder pane

parent c88df640
No related branches found
No related tags found
No related merge requests found
......@@ -788,14 +788,17 @@ Public Class FileBrowserDialog
Dim di As New DirectoryInfo(_myFolder)
Dim aryFi = di.GetDirectories(searchPat)
ImageList1.Images.Clear()
Dim shinfo = New SHFILEINFO()
shinfo.szDisplayName = New String(Chr(0), 260)
shinfo.szTypeName = New String(Chr(0), 80)
SHGetFileInfo(_myFolder, 0, shinfo, Marshal.SizeOf(shinfo), SHGFI_ICON Or SHGFI_SMALLICON)
Dim myIcon = Icon.FromHandle(shinfo.hIcon)
ImageList1.Images.Add(myIcon)
Dim x = ImageList1.Images.Count - 1
For Each fi In aryFi
ListViewFolder.Items.Add(fi.ToString, 0)
x += 1
Dim shinfo = New SHFILEINFO()
shinfo.szDisplayName = New String(Chr(0), 260)
shinfo.szTypeName = New String(Chr(0), 80)
SHGetFileInfo(Path.Combine(_myFolder, fi.ToString()), 0, shinfo, Marshal.SizeOf(shinfo), SHGFI_ICON Or SHGFI_SMALLICON)
Dim myIcon = Icon.FromHandle(shinfo.hIcon)
ImageList1.Images.Add(myIcon)
'For Each fi In aryFi
ListViewFolder.Items.Add(fi.ToString, x)
Next
Catch ex As Exception
ListViewFolder.Items.Add("<ERROR: " & ex.Message.ToString & ">")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment