I have:
Friend Sub WatchFullPath(ByVal zz As FileSystemEventHandler)
Dim watcher As New FileSystemWatcher()
watcher.Path = Disk.GetPath(gFullPath)
watcher.NotifyFilter = NotifyFilters.LastWrite
watcher.Filter = Disk.GetLastItem(gFullPath)
AddHandler watcher.Changed, zz
watcher.EnableRaisingEvents = True
and:
Friend Sub FileChanged(ByVal source As Object, ByVal e As
FileSystemEventArgs)
ComboBoxIngredients.Items.Clear()
End Sub
and:
WatchFullPath(AddressOf FileChanged)
When I change the file I get, pointing to
ComboBoxIngredients.Items.Clear():
the following:
Cross-thread operation not valid: Control 'ComboBoxIngredients' accessed
from a thread other than the thread it was created on.
Any suggestions on how to fix this?
Thanks in advance