Hi all,

I have created a splash screen and it fades in. When the splash screen closes, the main form (MDI) should open. The main form opens but then immediately closes. I am not sure what's going on, any ideas? Here is my code. Thanks.
vb Code:
  1. Public Class frmSplash
  2.     Private Sub frmSplash_FormClosing(ByVal sender As Object, _
  3.                                       ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
  4.  
  5.         'Opem the MDI form.
  6.         frmMain.Show()
  7.     End Sub
  8.  
  9.     Private Sub frmSplash_Load(ByVal sender As Object, _
  10.                                ByVal e As System.EventArgs) Handles Me.Load
  11.  
  12.         'Fade form in.
  13.         For i As Integer = 0 To 100 Step 1
  14.             Me.Opacity = i / 100
  15.             Me.Refresh()
  16.             Threading.Thread.Sleep(50)
  17.         Next i
  18.  
  19.         Me.Close()
  20.     End Sub
  21. End Class