I have a simple application that is monitoring a folder in VB.NET.
When a file is dropped into the folder I want the buttons on the form to become enabled. When I try to access the buttons on the form to enable them I receive the following error message.
Cross-thread operation not valid: Control 'btnExtractXML' accessed from a thread other than the thread it was created on.
Sub onChanged(ByVal from As Object, ByVal e As FileSystemEventArgs) Handles watcher.Created
btnExtractXML.Enabled = False
txtPickFile.Enabled = True
btnPickFile.Enabled = True
btnRun.Enabled = True