473,326 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Disposed exception at runtime but not in VS.NET

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.

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
Nov 15 '05 #1
1 1488
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
er**@cc.ensoft-software.com [remove the first "CC."]

"Scott" <scott_brittain@-NOSPAM-hotmail.com> wrote in message
news:uu**************@TK2MSFTNGP12.phx.gbl...
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.

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Ryan Park | last post by:
Hi, //SITUATION I got a panel control that hold a certain position on a form. Every controls or UIs are on this panel. At certain situation, I called dispose() method of this panel control...
2
by: michael Schindler | last post by:
I get an error message since i installed visual studio 2003 :-( Please help me why i get this message? An unhandled exception of type 'System.ObjectDisposedException' occurred in...
0
by: Scott | last post by:
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...
9
by: David Sworder | last post by:
Hi, I have a form that displays data (is that vague enough for you?). The data comes in on a thread-pool thread. Since the thread pool thread is not the same as the UI thread, the callback...
5
by: theinvisibleGhost | last post by:
I'm having a problem that occurs at random in my app. I get an exception "Cannot Access a disposed object" In MSCorLib when calling boolean Change (int32, int32) Stack trace reveals...
0
by: =?Utf-8?B?aGVyYmVydA==?= | last post by:
I read from a serialport using a worker thread. Because the worker thread t does not loop often, I cannot wait to terminate the worker thread using a boolean in the While condition. So I have a...
31
by: Zytan | last post by:
There is no IsDisposed() method. I could just access it, and catch ObjectDisposedException, but that seems ugly. Zytan
1
by: Amit Dedhia | last post by:
Hi I am having problem working with Timers in C++/CLI (the .NET version of C++) I have an application which has several forms with pictureBox controls on it. There is a background timer...
5
by: aine_canby | last post by:
Hi, The problem is that the line - this.Invoke(new MyDelegate(Function), args); // this = MainForm is being called after the line - terminatePopulate = true; therefore I get an exception...
4
JustRun
by: JustRun | last post by:
Hi All, I'm developing a windows desktop solution using VC# , I deal with my database using Dataset. My Problem that i'm trying to call a Form to display a confirmation message after every...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.