
User control is not in toolbox
March 12, 2008Po pridani user controlu se user control nezobrazi v toolboxu:
-
Moje reseni:
Ma user control implicitni konstruktor???
Pokud doplnis implicitni konstruktor a user control nelze vlozit (treba kvuli servicam v bindovani (binding umistovat explicitne!!!! ne implicitne kvuli injectioningu)), potom pouzit:if (!DesignMode)
{} - My solution
Try to add implicit constructor.
Use !DesignMode for a dynamic stuffs like DataBindings etc… if (!DesignMode) { }
- Official solution
This is a bug in Visual Studio when using Solution Folders. A workaround is to drag your projects with user controls to the root of the solution then save, close and reopen VS, your user controls will appear in the toolbar and you will can use it to design your forms/views, once you finished move the projects to its original solution folder.
You can find this issue here: - http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=289769