The Visual Studio 2005 Toolbox, UserControls and Solution Folders#

There's a pretty inconvenient bug in the Windows Forms designer in Visual Studio 2005, which apparently is a known issue but not scheduled to be fixed anytime soon. Here's the scoop and a (slightly sucky) workaround...

If you have a User Control in your project, it will automatically get added to the Toolbox window so you can drag it onto your designer surface. However, it doesn't show up in the Toolbox if the project is inside a Solution Folder (which is a virtual folder in your solution). It would be really nice if it were also possible to drag the user control from the Solution Explorer onto the designer surface, but unfortunately that's not supported.

So a possible workaround is to take the simplest type of control available (I tend to go for a plain old Panel) and add that to the form in stead of the user control you really want to add. Then switch to the designer-generated code (e.g. MyForm.Designer.cs) and change both the declaration of the panel (e.g. "private System.Windows.Forms.Panel panel1;") and the instantiation (e.g. "this.panel1 = new System.Windows.Forms.Panel();" inside the "Windows Form Designer generated code" region) to your user control type (e.g. MyNamespace.MyUserControl).

It sucks, but it works.

Blog | Programming | .NET | Quirks | VS.NET | WinForms
Friday, June 23, 2006 8:03:33 PM (Romance Standard Time, UTC+01:00)
Have you tried the RazorToolbox add-in for Visual Studio .NET 2005? Maybe it can help you out with a more cleaner workaround.

http://www.delarou.net/weblog/PermaLink,guid,24dfef70-29d5-4b73-8ced-698c3713dcc5.aspx

There's also a short movie that demonstrates it's use. It's worth a try ...


Wednesday, November 01, 2006 12:55:00 PM (Romance Standard Time, UTC+01:00)
RazorToolbox works for VS 2003 only :(
Martin Schmidt
Tuesday, March 06, 2007 10:13:09 PM (Romance Standard Time, UTC+01:00)
Related issue... I had this happening all the time (solution forder or not). Google "AutoToolboxPopulate" for the solution...
Mo
Tuesday, May 22, 2007 3:42:10 PM (Romance Standard Time, UTC+01:00)
The "AutoToolboxPopulate" feature isn't the solution.

The RazorToolbox addin works great, and is available for VS2005! Thanx for the nice bugsolving strap-on.
Btw. this is the direct link to RazorToolbox:
http://www.istaysharp.net/index.php?title=IStaySharp.RazorToolbox&printable=yes

greetz..

Freek
(the Netherlands)
Sunday, July 01, 2007 8:34:11 PM (Romance Standard Time, UTC+01:00)
Known bug:

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=144156
Comments are closed.
All content © 2008, Jelle Druyts
On this page

Recent Photos
www.flickr.com
This is a Flickr badge showing public photos from Jelle Druyts. Make your own badge here.
Advertising
Top Picks
Statistics
Total Posts: 346
This Year: 9
This Month: 0
This Week: 0
Comments: 525
Archives
Sitemap
Disclaimer
This is my personal website, not my boss', not my mother's, and certainly not the pope's. My personal opinions may be irrelevant, inaccurate, boring or even plain wrong, I'm sorry if that makes you feel uncomfortable. But then again, you don't have to read them, I just hope you'll find something interesting here now and then. I'll certainly do my best. But if you don't like it, go read the pope's blog. I'm sure it's fascinating.

Powered by:
newtelligence dasBlog 2.0.7226.0

Sign In