title: Handle form created in code (WinForms)
body: <p>I ran into a little problem. With this piece of code, I create a <strong>new</strong> form for every ".jpg" file in a folder: </p>
  
  <pre><code>Dim d As DirectoryInfo = New DirectoryInfo("path to folder")
  
  For Each bild As FileInfo In d.GetFiles("*.jpg")
  
      Dim p As New Form
      p.Show()
  
  Next
  </code></pre>
  
  <p>Now I have some trouble handling the forms (p) event. I know how to handle forms that were created in code but this doesn't work if more then one form were created. Just the last one gets the events.</p>
  
  <pre><code>AddHandler p.Click, AddressOf p_click()
  </code></pre>
  
  <p>In short: How can every form get the event (p_click) when multiple forms are created in code?</p>