Hey. Ok so i'm having a problem in my program, so instead of trying to find the bug right away, I decided to test the problem that I'm having by creating a new basic program with two forms. It seems that if I make a new instance of a form, and don't set it to visible, then that form won't run the .closing method. Here's what I did:

Form1- contains 1 button

VB Code:
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.         If f2 Is Nothing Then
  3.             f2 = New Form2
  4.         End If
  5.     End Sub

form 2

- contains 1 timer
- modified .closing method

VB Code:
  1. Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  2.         MsgBox("time to run the closing code")
  3.         Me.Close()
  4.     End Sub

VB Code:
  1. Private Sub Form2_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
  2.         MsgBox("doing the actual closing now!")
  3.         Me.Dispose()
  4.         f2 = Nothing
  5.     End Sub


Module

VB Code:
  1. Friend Module DuckyModule
  2.     Friend f1 As Form1 ' can now be accessed from anywhere.
  3.     Friend f2 As Form2
  4.  
  5. End Module

Ok so, the timer is designed to within 5 seconds close form2 when it starts. If I don't do anything about seting the form visible (like .showDialog) then when the timer calls .close() then nothing happens! If I put in .setDialog() then the when the timer calls .close() then it works!. Is this normal? Any ideas on what I could do?

Thanks
John