title: VB.NET .NET after load event?
body: <p>I need some way of knowing when a form has finished loading. My reasoning is I have a second form that is loaded when this form loads. The code for this is called from <code>form1.load</code>.</p>
  
  <p><code>Form2</code> is currently being displayed behind <code>form1</code> as I am guessing <code>form1</code> calls an activate or similar at the end of the load so any Activate, BringToFront, etc. calls on <code>form2</code> are overridden.</p>
  
  <p>If you look at the code below, I have tried adding <code>frmAllocationSearch.Activate</code>, <code>frmAllocationSearch.BringToFront</code> and <code>Me.SendToBack</code> after the call to <code>ShowAlloactionSearchDialog()</code>,  but these are all wasted as something is happening after the load event is fired to bring <code>Me</code> to the front.</p>
  
  <p>The code is:</p>
  
  <pre><code>Private Sub Allocation_Load(ByVal sender As Object, ByVal e As System.EventArgs) _
                              Handles Me.Load
  
      ShowAlloactionSearchDialog()
  End Sub
  
  Private Sub ShowAlloactionSearchDialog()
  
      If frmAllocationSearch Is Nothing OrElse frmAllocationSearch.IsDisposed Then
          frmAllocationSearch = New AllocationSearch
          frmAllocationSearch.MdiParent = Me.MdiParent
          frmAllocationSearch.Info = Me.Info
          frmAllocationSearch.Top = Me.Top
          frmAllocationSearch.Left = Me.Left + Me.Width - frmAllocationSearch.Width
          frmAllocationSearch.AllocationWindow = Me
  
          frmAllocationSearch.Show()
      Else
          If frmAllocationSearch.WindowState = FormWindowState.Minimized Then
              frmAllocationSearch.WindowState = FormWindowState.Normal
          End IF
          frmAllocationSearch.Activate()
      End If
  End Sub
  </code></pre>