#MODS PLEASE DISREGARD MY LAST TWO ATTEMPTS TO POST THIS, THIS IS THE ONE I WANT#

Hi all,

I'm hoping someone far smarter than me can help me with a small issue I have with an application I am developing.

My application uses a list view that populates with images from files. The items in the list can be edited by the user including updating the menu images but when that happens the list view loses all it's images and won't reload them without re-booting the application.

Here's a screen shot of my list view when you first start up the app

Screeshot1

..which is correct. and here is the code that loads the images (lvBinSelect is the list view in question)..

Code:
      Function UpdateCalcPicList()

        lvBinSelect.Items.Clear()
        ImageList1.Images.Clear()
        GC.Collect()
        MenuCntr = 0

        MenuTEXT = File.ReadAllLines(Application.StartupPath & "\App Files\Bins\Config.cfg")

        For Each i In MenuTEXT
            ImageList1.Images.Add(i, Image.FromFile(Application.StartupPath & "\App Files\Bins\" & i & "\Menu.png"))
            lvBinSelect.Items.Add(i, i)
        Next i

        Return True
    End Function
I run this in the form load event and all is hunky dory. FYI, the Config.cfg file it is reading contains the name of the items which corresponds to the folder name their image is in.

But now the issue of a user trying to change the image associated with each item. This is done on a different tab (there is a tab control being used I have just hidden the tabs with a panel with images to select instead and have moved the panel a bit so you can see what I mean in this next screenie)...

Screenshot2

When the button highlighted is pressed a dialogue appears allowing the user to pick a new png for the 'menu image' to be used in the list view on the previous tab. The code is as follows..

Code:
        Dim openFileDialog1 As OpenFileDialog = New OpenFileDialog

        openFileDialog1.Filter = "PNG Files (*.png)|*.png"
        openFileDialog1.FilterIndex = 1
        openFileDialog1.Multiselect = False
        openFileDialog1.Title = "Please select Menu PNG file"


        With openFileDialog1
            '...
            If .ShowDialog = Windows.Forms.DialogResult.OK Then
                'Open the selected file to read.
                picBinSave.BackgroundImage.Dispose()
                picMenuSave.BackgroundImage.Dispose()
                GC.Collect()
                ImageList1.Dispose()
                lvBinSelect.Clear()
                GC.Collect()

                If File.Exists(Application.StartupPath & "\App Files\Bins\" & lstBinList.SelectedItem & "\Menu.png") = True Then
                    FileIO.FileSystem.DeleteFile(Application.StartupPath & "\App Files\Bins\" & lstBinList.SelectedItem & "\Menu.png")
                End If

                FileIO.FileSystem.CopyFile(openFileDialog1.FileName, Application.StartupPath & "\App Files\Bins\" & lstBinList.SelectedItem & "\Menu.png")

                picBinSave.BackgroundImage = Image.FromFile(Application.StartupPath & "\App Files\Bins\" & lstBinList.SelectedItem & "\Bin.png")
                picMenuSave.BackgroundImage = Image.FromFile(Application.StartupPath & "\App Files\Bins\" & lstBinList.SelectedItem & "\Menu.png")
                
Call UpdateCalcPicList()


            End If

        End With
picBinSave and picMenuSave are the image boxes on the second tab you see in the last screen shot that previews the images. These refresh perfectly on updating.

Now as you can see it calls the UpdateCalcPicList function again after clearing the list view which should in theory repopulate the list view with the updated images.

But All I get is this after a user has changed an image and they go back to the first tab....

Screenshot3

The images are loading back into teh list view. The only way to get them back is to restart the application and it's fine again and load with the new image the user changed to. I have had to use 'Application.Restart()' after the change is made as a workwround but this is obviously not ideal.

Can anyone help, much appreciation in advance.