Disposed exception at runtime but not in VS.NET

S

Scott

I'm getting a ObjectDisposedException from my Winform EXE, but not when I run the identical test case in the VS.NET debugger

Our application is a run-of-the-mill two pane (like outlook) app that dynamically creates the right-side user control based on what node you click on the left-side treeview control. Before creating the new user control, the old one is queried to see if any of its data has changed and therefore should be saved

The exception thrown is

System.ObjectDisposedException:
Cannot access a disposed object named "Button"
Object name: "Button"
at System.Windows.Forms.Control.CreateHandle(

And it occurs when a user clicks from the left-side treeview control immediately onto one of the right-side user control's contained controls (e.g. a combo box or button)

I'd be happy to provide any addition detail or code that would help find a solution

Thanks.
 
E

Eric Newton

I'm assuming the user even has the ability to click the button/control about
to be hidden because the save operation is taking >500ms, perhaps try
Enable=false on the right side before starting the TestForDirty/Save op


--
Eric Newton
C#/ASP Application Developer
(e-mail address removed)-software.com [remove the first "CC."]

Scott said:
I'm getting a ObjectDisposedException from my Winform EXE, but not when I
run the identical test case in the VS.NET debugger.
Our application is a run-of-the-mill two pane (like outlook) app that
dynamically creates the right-side user control based on what node you click
on the left-side treeview control. Before creating the new user control,
the old one is queried to see if any of its data has changed and therefore
should be saved.
The exception thrown is:

System.ObjectDisposedException:
Cannot access a disposed object named "Button".
Object name: "Button".
at System.Windows.Forms.Control.CreateHandle()

And it occurs when a user clicks from the left-side treeview control
immediately onto one of the right-side user control's contained controls
(e.g. a combo box or button).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top