I have:
Friend Sub WatchFullPath(B yVal zz As FileSystemEvent Handler)
Dim watcher As New FileSystemWatch er()
watcher.Path = Disk.GetPath(gF ullPath)
watcher.NotifyF ilter = NotifyFilters.L astWrite
watcher.Filter = Disk.GetLastIte m(gFullPath)
AddHandler watcher.Changed , zz
watcher.EnableR aisingEvents = True
and:
Friend Sub FileChanged(ByV al source As Object, ByVal e As
FileSystemEvent Args)
ComboBoxIngredi ents.Items.Clea r()
End Sub
and:
WatchFullPath(A ddressOf FileChanged)
When I change the file I get, pointing to
ComboBoxIngredi ents.Items.Clea r():
the following:
Cross-thread operation not valid: Control 'ComboBoxIngred ients' accessed
from a thread other than the thread it was created on.
Any suggestions on how to fix this?
Thanks in advance
Friend Sub WatchFullPath(B yVal zz As FileSystemEvent Handler)
Dim watcher As New FileSystemWatch er()
watcher.Path = Disk.GetPath(gF ullPath)
watcher.NotifyF ilter = NotifyFilters.L astWrite
watcher.Filter = Disk.GetLastIte m(gFullPath)
AddHandler watcher.Changed , zz
watcher.EnableR aisingEvents = True
and:
Friend Sub FileChanged(ByV al source As Object, ByVal e As
FileSystemEvent Args)
ComboBoxIngredi ents.Items.Clea r()
End Sub
and:
WatchFullPath(A ddressOf FileChanged)
When I change the file I get, pointing to
ComboBoxIngredi ents.Items.Clea r():
the following:
Cross-thread operation not valid: Control 'ComboBoxIngred ients' accessed
from a thread other than the thread it was created on.
Any suggestions on how to fix this?
Thanks in advance
Comment