Herfried,
One minor addition:
Private Sub MdiChild_Closed( _
ByVal sender As Object, _
ByVal e As System.EventArgs _
)
MsgBox( _
"MdiChild with handle " & _
DirectCast(sender, Form).Handle.ToString() & _
" closed!" _
)
m_child = nothing
Which will allow a new Form2 to be created after the first Form2 is
closed...
As an alternative I will implement Form2 as a Singleton itself. Something
like:
Public Form2
Inherits Form
' form designer created this function, we are just making it private
Private Sub New
end sub
private shared m_instance as Form2
public shared readonly property Instance As Form2
get
if m_instance is nothing then m_instance = new form2
return m_instance
end get
end property
private sub form2_closed(...) handles mybase.closed
m_instance = nothing
end sub
Which will reset the instance variable when the form is closed, allowing a
new instance to be created when needed...
Hope this helps
Jay
open?