title: How to raise events from class library to form using module?
body: <p>i've a app that starts from a sub in a module, do a few things, and then load the form. </p>
  
  <p>But it doesn't work :/</p>
  
  <p>Here we execute <strong>dBase.AddTemporalFilepath</strong></p>
  
  <p>module.vb</p>
  
  <pre><code>Public dBase As New Core.clsDatabase
  
  Public Sub Main()
  
      FurBase.Directory = My.Application.Info.DirectoryPath
  
      If appMutex.WaitOne(TimeSpan.Zero, True) Then
          ShowUploader()
      End If
  
      Dim returnValue As String()
  
      returnValue = Environment.GetCommandLineArgs()
  
      If returnValue.Length &gt; 1 Then
          If My.Computer.FileSystem.FileExists(returnValue(1).ToString) Then
              dBase.AddTemporalFilepath(returnValue(1).ToString)
          End If
      End If
  
  End Sub
  
  Private Sub ShowUploader()
      Application.EnableVisualStyles()
      Application.Run(frmUploader)
  End Sub
  </code></pre>
  
  <p>We raise the event <strong>TempFilepathAdded</strong></p>
  
  <p>clsDatabase.vb</p>
  
  <pre><code>Public Class clsDatabase
  
  Public Event TempFilepathAdded()
  
  Public Function AddTemporalFilepath(ByVal filepath As String)
  ...
          RaiseEvent TempFilepathAdded()
  ...
  End Function
  
  End Class
  </code></pre>
  
  <p>We catch the event</p>
  
  <p>form.vb</p>
  
  <pre><code>Private Sub form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  
      AddHandler dBase.TempFilepathAdded, AddressOf TempFilepathAddedHandler
  
  End Sub
  
  Private Sub TempFilepathAddedHandler()
      MsgBox("Event raised")
  End Sub
  </code></pre>
  
  <p>Any Idea?</p>
  
  <p><strong>More info:</strong></p>
  
  <p>The event is raised when the form is closed.</p>