Hi,
I am trying to write an application where I have multiple forms. I am trying to keep the memory usage low as well.
So I thought I would open a form when requested, then when I close the form it will release the memory but it does not. (That’s the first problem)
Secondly, when I try to open the form that I just closed it errors on me.
The error message is:
An unhandled exception of type 'System.ObjectDisposedException' occurred in system.windows.forms.dll
Additional information: Cannot access a disposed object named "Form2".
I am using a module to open my forms. The code is below.
The sub showfrm2 opens my form fine the first time but when I close it then try to open it again it errors on me.
Module SubMain
Dim frm1 As New Form1
Dim frm2 As New Form2
Sub Main()
Frm1.ShowDialog()
End Sub
Sub showfrm2()
Frm2.Show() - error occurs here
End Sub
End Module
Any ideas???
Thanks
Manraj
I am trying to write an application where I have multiple forms. I am trying to keep the memory usage low as well.
So I thought I would open a form when requested, then when I close the form it will release the memory but it does not. (That’s the first problem)
Secondly, when I try to open the form that I just closed it errors on me.
The error message is:
An unhandled exception of type 'System.ObjectDisposedException' occurred in system.windows.forms.dll
Additional information: Cannot access a disposed object named "Form2".
I am using a module to open my forms. The code is below.
The sub showfrm2 opens my form fine the first time but when I close it then try to open it again it errors on me.
Module SubMain
Dim frm1 As New Form1
Dim frm2 As New Form2
Sub Main()
Frm1.ShowDialog()
End Sub
Sub showfrm2()
Frm2.Show() - error occurs here
End Sub
End Module
Any ideas???
Thanks
Manraj