NEWBIE -> Updating listview item on event change

motti100

Member
Joined
Mar 6, 2005
Messages
19
Programming Experience
1-3
PLEASE HELP!!!!!! Updating listview item on event change

Refresh did not work.

What I am doing is the following.

I select 3 directories to watch.
I then click on a button to start the watchdog.

In the button code, I populate the Listview with the directory.path and directory size. like this

Directory Size
c:\test1 101010
c:\test2 23323232
c:\test3 0

Now, if I say (from Explorer) delete a file from the directory (c:\test1), I want to see updated in listview

Directory Size
c:\test1 8000
c:\test2 23323232
c:\test3 0


my button code looks like:

If watchfolder.Path <> "" Then

Dim str(1) AsString

Dim itm As ListViewItem

str(0) = FBD1.SelectedPath

str(1) = GetFolderSize(watchfolder.Path)

itm =
New ListViewItem(str)

ListView1.Items.Add(itm)

EndIf

The code also has a handler to Event (changed file, deleted file, etc)

When the file is deleted, the directory size is decreased.

I need to update the list view in the Handler code to update just the value that chaged ie SIZE

Directory Size
c:\test1 8000
c:\test2 23323232
c:\test3 0

Thanks
 
Last edited:
Back
Top