Visual Studio 2008 では、コントロールを検出してプロジェクトからツールボックスに追加し、フォーム デザイナで使用できるようになりました。UserControl 派生型または DataSet 派生型のアセンブリがある場合は、そのコントロールが自動的に検出され、フォームをデザインするためのツールボックスに追加されます。これは、2005 年に手動でコントロールを追加し、時々それらを忘れていた古いシステムよりもわずかに優れています。
However, on the legacy, monolithic project I am working on (now upgraded to vs2008) this means many controls that I don't want and don't need (and a redesign would not be warranted against so much legacy code :( ). I imagine that if I made certain types internal or private, then they wouldn't show up. However, I need many of those to remain public, but not show up in the toolbox. Furthermore, with so many controls getting added to the toolbox, opening the winforms designer slows significantly.
- Is there an attribute or other mechanism that prevents toolbox appearance (that wouldn't otherwise affect functionality) ?
- Would filtering using such a mechanism improve performance while still autodetecting new types that SHOULD be in the toolbox? (I know you can disable the autodetect, but its nice to have in many cases)
- Have others encountered this irritation on large solutions (with many csproj/vbproj files)?
Edit: Thanks everyone! I knew it had to be simple (and was likely an attribute) but that fills the gap. Nice to know that I was in good company in not knowing about ToolBoxItem(false).