asked on
Form load
watchfolder = New System.IO.FileSystemWatcher()
watchfolder.Path = C:\
AddHandler watchfolder.Created, AddressOf logchange
watchfolder.EnableRaisingEvents = True
Private Sub logchange(ByVal source As Object, ByVal e As System.IO.FileSystemEventArgs)
timer1.enable = true
End sub
ASKER
ASKER
ASKER
ASKER
Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to Visual Basic pre-2002, it is not the same technology,
TRUSTED BY
If that is the case, then the problem is likely due to the separate-threaded nature of the "logchange" callback. You could maybe ask the form to invoke a method that would start the timer (this might be a bad solution because I know the FileSystemWatcher can fire many many events).
(Untested Code)
Open in new window
Another would be to declare a timer object as Shared and hopefully be able to start it from a different thread (without using the Forms designer). Let me know if you want help doing something like that.
Best of Luck.