Cannot remove a user control from the toolbox

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: BBM (bbm_at_bbmcompany.com)
Date: 09/08/04


Date: Wed, 8 Sep 2004 14:05:08 -0700

I'm having a devil of a time with VS "losing" my user controls from forms.
Earlier today, I suddenly started having "System.OutOfMemoryException"
crashes after a simple (or so I thought) change to one of the user controls
on the main form.

When I went to the visual design version of my main form, one of my user
controls showed a whole series of errors in text INSIDE the panel. I deleted
the control from the form and attempted to add it back from the toolbox and
got exactly the same display (error messages written inside the control
outline).

Since the solution has been compiling without errors, I assumed that the
problem was probably that VS had somehow lost it's link to the user control.
So, I tried to remove the user control from the toolbox (thinking I'd re-add
it and restore the link). I used the Add/Remove toolbox controls dialog, and
unchecked the offending user control and hit OK. No errors, but the User
Control is still in the toolbox, and I still get the error behavior if I try
to use it. The "removed" control no longer shows in the Add/Remove control
dialog.

I'm considering using the "Reset" key on the Add/Remove dialog, but I have a
number of other custom controls, and other user controls that use those
custom controls and I'm not looking forward to re-doing all that stuff.

I have all the source backed up in Visual SourceSafe, but I don't think that
returning to a previous source version will help this toolbox problem.

Does anybody have any ideas how to get the "old" reference out of the
toolbox without blowing everything away?

Thanks.

BBM

PS. My code started blowing up when I started doing a "default"
instantiation of two working objects on one of the user controls. The
constructor of the user control "binds" properties from one of the working
objects to controls on the main panel of the user control.

So my code was changed from...

DFType wdf;
DFType edf;

to...

DFType wdf = new DFType(); // properties later bound in the constructor
DFType edf = new DFType();

DFType is very small and simple.
wdf has properties bound to controls on the user control's main panel.



Relevant Pages

  • How to keep cursor within the scope of a custom user control ?? Got it to work, kind of.
    ... I created a frmMain ArrayList of the user controls hosted by frmMain. ... the cursor still jumped from the selected user control to ... frmMain when I tabbed past the last textbox on the user control. ...
    (microsoft.public.dotnet.languages.csharp)
  • How do you directly send messages / events to controls?
    ... each textbox, and these leave events update a data structure which is ... I have a user control, which has a FlowLayout Panel which has other user ... The user controls in the panel are mostly just visual ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Cannot remove a user control from the toolbox
    ... Unless the toolbox will allow you to remove the item from the context menu ... (which I doubt, as "Delete" is normally disabled for user controls), I'm ... I tried to remove the user control from the toolbox (thinking I'd ... >DFType wdf; ...
    (microsoft.public.vstudio.development)
  • Re: How to Prevent Mouse Movement and Clicks From Reaching Control
    ... > This will keep all of your controls from receiving any mouse messages. ... the user control has a check box on ... >> Is there a way that I can simulate the design mode effect of the VS IDE, ... >> whereupon the form should behave normally. ...
    (microsoft.public.dotnet.languages.vb)
  • Inherited controls dont appear in toolbox
    ... I've created a user control: ... Public Class Button ... Now such controls don't show up in the toolbox when i open the project on ...
    (microsoft.public.dotnet.languages.vb)