G
Guest
active,
Look up Control.Invoke in the online help.
Kerry Moorman
Look up Control.Invoke in the online help.
Kerry Moorman
active said: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.
active said:While reading about Control.Invoke I stumbled across SynchronizingObject
and tried it but wasn't sure it what I did was OK.
While reading about Control.Invoke I stumbled across SynchronizingObject and
tried it but wasn't sure it what I did was OK.
Thanks for verifying for me that it is a good way to go.
active said:While reading about Control.Invoke I stumbled across SynchronizingObject
and tried it but wasn't sure it what I did was OK.
Thanks for verifying for me that it is a good way to go.