Could some on please explain how to code for the invoke and dispose syntax please i am having problems with this code
And the error is:
From what i have read up on the error. I need to invoke and dispose any ideas i know i dont......
Thanks in advance
Jimmy22
VB.NET:
Private Sub logchange(ByVal source As Object, ByVal e As System.IO.FileSystemEventArgs)
If e.ChangeType = WatcherChangeTypes.Changed Then
Me.txtlog.Text &= "File " & e.FullPath & "has been modified" & vbCrLf
End If
If e.ChangeType = WatcherChangeTypes.Created Then
Me.txtlog.Text &= "File " & e.FullPath & "has been created" & vbCrLf
End If
If e.ChangeType = WatcherChangeTypes.Deleted Then
Me.txtlog.Text &= "File " & e.FullPath & "has been deleted" & vbCrLf
End If
End Sub
'This is the code for handling the Renamed event raised by the FileSystemWatcher class:
Public Sub logrename(ByVal source As Object, ByVal e As System.IO.RenamedEventArgs)
Me.txtlog.Text &= "File" & e.OldName & " has been renamed to " & e.Name & vbCrLf
End Sub
"Cross-thread operation not valid: Control 'txtlog' accessed from a thread other than the thread it was created on."
From what i have read up on the error. I need to invoke and dispose any ideas i know i dont......
Thanks in advance
Jimmy22
Last edited by a moderator: