Cross Thread Not Valid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using the FileSystemWatcher and think that I need to use invoke on the
code below:

Private Sub dirMon_InformationMessageEvent(ByVal InformationMessage As String)
Me.txtActivity.Text = (InformationMessage & Me.txtActivity.Text)
End Sub

The program fails when I am trying to update the textbox as shown so that
the user can see the progress. Is there an easy way that I can use Invoke
and pass the InformationMessage variable, as this contains the message for
the user to see.
 
Here is how I set up the event handler which goes with the code from the
previous post:

'Set up the handler for the "InformationMessageEvent" event.
'This will enable the application to receive messages from the directory
object.
AddHandler _dirMon.infoMessageEvent, New
DirectoryMirror.infoMessageDelegate(AddressOf dirMon_InformationMessageEvent)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top