I'm using VB.net 2008...
Within the program, there is a button that opens a file inside of a second form ( DocViewFrm
) and it works fine the first time around. Within this new window, there is a button that uses Me.Close()
to close the window and return to the main window. Upon the attempt to open this second form a second time, the program crashes on the Me.DocViewFrm.Show()
line. The error message reads:
An unhandled exception of type 'System.ObjectDisposedException' occurred in System.Windows.Forms.dll
Additional information: Cannot access a disposed object.
What method must be used to close this window properly so that I can open another one later? Any help is MUCH appreciated!