Event visibility

  • Thread starter Thread starter John Dann
  • Start date Start date
J

John Dann

An elementary question I know, but I've just realised that I don't
know the answer:

I want to use the FileSystemWatcher component. Its only obvious way
of use is to add this to a form. (Maybe there is a way of adding it to
a non-form class?). But I want to handle the FSW event in a non-form
class. But despite having reset its scope from Friend to Public (maybe
Friend is the right choice anyhow?) the FSW events don't appear on the
dropdown list of other classes. What do I need to do please?

TIA
JGD
 
Hi,

Declare the variable withevents to have access to the events

Public Class MyFileWatcherClass

Private WithEvents fsw As New System.IO.FileSystemWatcher("C:\Temp")



End Class



Ken

---------------------------

An elementary question I know, but I've just realised that I don't
know the answer:

I want to use the FileSystemWatcher component. Its only obvious way
of use is to add this to a form. (Maybe there is a way of adding it to
a non-form class?). But I want to handle the FSW event in a non-form
class. But despite having reset its scope from Friend to Public (maybe
Friend is the right choice anyhow?) the FSW events don't appear on the
dropdown list of other classes. What do I need to do please?

TIA
JGD
 
Back
Top