title: Event Raised in a class, handle this event in a form no response
body: <p>I am working with <code>VS2008</code> on <code>Win 7</code> os. My problem here is in my app is reading scanner data using a <code>class -- class1</code>, so once the data is read, I send out code to raise an event from another <code>class -- class2</code>. I have multiple forms that could use this scanned data, so, whatever the form on top will handle this even. I can see the event raised, but the handler on the active form doesn't response. Could you please tell me what is the problem in my code?</p>
  
  <p><em>class1 read the scanned data and call class2 to raise event</em>:</p>
  
  <pre><code>Public Class class1   
      Private WithEvents evnt As New class2
  
      Private Sub DataReceived()       
          evnt.ScanData()        
      End Sub
  End class   'end class1
  
  Public Class class2
      Public Event NewScanData(ByVal ScanData As String)
  
      Public Sub ScanData()
          RaiseEvent NewScanData(ScanData)
          'MsgBox("Invoked event")
      End Sub
  End Class    'end class2
  </code></pre>
  
  <p>** note: I can see the message Invoked event shows, that means event does get raised. but the form class below seems not receiving the event:</p>
  
  <pre><code>Public Class Form1
      Friend WithEvents event1 As New class2
      Private Sub GetScanData(ByVal ScanData As String) Handles event1.NewScanData
           'do something to process scanned data
      End sub
  End Class
  </code></pre>
  
  <p>Thanks you</p>