A
Arjan
Hi,
I open a child form with a menubutton in the parentform -> no problem
2nd: Open a second child form with a button on the first child form -> no
problem
3rd: Open the first child form in the Closed Event from the second child
form -> still no problem
4th: Now the problem raises: When I open again the second form with the
button on the first child form an Error occurs which say's:
An unhandled exception of type 'System.ObjectDisposedException' occurred in
system.windows.forms.dll
Additional information: Cannot access a disposed object named
"frmProjectEdit"."
What could this be?
Thanks for your help.
Arjan
------------------------------------------------------
Worked out code in order of mentioned steps above:
Declared in module :
Public frmParent As New Form1 'MDI Parent
Public frmProjectOpen As New frmProjectDataOpen 'Child1
Public frmEdit As New frmProjectEdit 'Child2
Openening first child form with:
frmProjectOpen.MdiParent = Me
frmProjectOpen.Show()
Openening 2nd child form with button on first child form:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.Hide()
frmEdit.MdiParent = Me.MdiParent
frmEdit.Show()
End Sub
Back to first child with 2nd child Closed Event:
Private Sub frmProjectEdit_Closed(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Closed
frmProjectOpen.MdiParent = Me.MdiParent
frmProjectOpen.Show()
End Sub
I open a child form with a menubutton in the parentform -> no problem
2nd: Open a second child form with a button on the first child form -> no
problem
3rd: Open the first child form in the Closed Event from the second child
form -> still no problem
4th: Now the problem raises: When I open again the second form with the
button on the first child form an Error occurs which say's:
An unhandled exception of type 'System.ObjectDisposedException' occurred in
system.windows.forms.dll
Additional information: Cannot access a disposed object named
"frmProjectEdit"."
What could this be?
Thanks for your help.
Arjan
------------------------------------------------------
Worked out code in order of mentioned steps above:
Declared in module :
Public frmParent As New Form1 'MDI Parent
Public frmProjectOpen As New frmProjectDataOpen 'Child1
Public frmEdit As New frmProjectEdit 'Child2
Openening first child form with:
frmProjectOpen.MdiParent = Me
frmProjectOpen.Show()
Openening 2nd child form with button on first child form:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.Hide()
frmEdit.MdiParent = Me.MdiParent
frmEdit.Show()
End Sub
Back to first child with 2nd child Closed Event:
Private Sub frmProjectEdit_Closed(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Closed
frmProjectOpen.MdiParent = Me.MdiParent
frmProjectOpen.Show()
End Sub