The Control *control* has thrown an unhandled exception in the designer and has been disabled - by Andrew Coombs

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 540882 Comments
Status Resolved Workarounds
Type Bug Repros 0
Opened 3/10/2010 5:37:07 AM
Access Restriction Public


The Control *control* has thrown an unhandled exception in the designer and has been disabled.

Cannot access a disposed object.
Object name: 'SplitterPanel'.

Stack trace:

This error occurs when I place a custom control whose base is a UserControl inside a Panel/Tab Control etc on my form. It appears the order the controls are added to the form effect the exception being thrown.

If I add the UserControl and then the panel, then drag the UserControl onto the panel the exception doesn't get thrown. However if the Panel is already on the form before the UserControl is placed on the form, and then nested, the exception occurs whenever the designer re-intialises the designer pane, or the pane is closed.
Sign in to post a comment.
Posted by Microsoft on 7/14/2010 at 9:54 AM
Thank you Andrew for reporting this! We are sorry to let you know that we cannot provide a fix for this as we are having a higher bar for WinForms since now.
If you use a debugger (could be another VisualStudio instance) to the VisualStudio, and catch the first chance exceptions, it should be easy for you to get the callstack.
Posted by Microsoft on 4/19/2010 at 10:58 PM
Hi Andrew, we did not repro the exact exception following your steps. Do you mind to share your custom control with us (or a simple repro project) and we can investigate to see if the exception can be made more precise? Thanks!
Posted by Andrew Coombs on 3/10/2010 at 7:41 AM
I have finally fixed this issue, and it was nothing to do with what I thought. The actual error was in a custom textbox inside the custom control. We have a third party spell checker module added to the textbox. The textbox was being added to the spell checking list twice, and thus when being disposed was being removed from the list twice or something along those lines.

However, the VS 2008 exception dialog could have been alot more helpful by not pointing the finger at the splitter panel which was 2 parents up from the offending textbox (SplitterPanel/TablePanel/TextBox) and NO stack trace at all.