System.ObjectDisposedException

  • Thread starter Thread starter KV
  • Start date Start date
K

KV

In my application, I had created a library that includes a form, in the main
App, it calls the lib and that form will be shown.everytime run to here,
error promate: error: System.ObjectDisposedException.
 
Are you calling the form with ShowDialog? If so this disposes the form after
it is dismissed and so is only good for one showing. You could either
recreate a new instance of the same form each time, or use Show instead.

Peter
 
In that case where is the form instance declared in the class library such
that it doesn't go out of scope between calls from your application?

Peter
 
Back
Top