I have some UserControls that I created in ProjectA. I have ProjectB that has a windows form that I want to put the controls on. Both of these projects are in a single sol
Before trying to add a custom control, make sure that it is compatible with the .Net version of your current project.
I was trying to add a custom control to toolbox for a project for Windows CE 5.0 and .Net Compact v3.5 on VS2008. I did all those previous suggestions but nothing worked. The control shows up when "show all" is checked but it is grayed , even in "Choose Items" menu is checked.
I created a new project with .Net v2.0 and it worked perfectly.
hello its answer Ctrl+Alt+X take this and later u have TOOLBOX :)
Check this setting:
Tools > Options > Windows Forms Designer > General : AutoToolboxPopulate
It should be set to True for this to work.
For someone who might be working with ToolStripItems
(e.g. ToolStripStatusLabel
), to actually get your derived control to show up in the dropdown menu (such as the one from StatusStrip
), you need to set the class to public
then build the solution.
Also don't forget the designer attribute for your class, something like this:
using System.Windows.Forms.Design;
[ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.StatusStrip)]
public class MyStatusLabel : ToolStripStatusLabel
{
}
Took me a while to get it right. Hopefully this can save someone else's time.
In your UserControl, make sure that New is declared Public. It won't show up if it's just declared Sub New (which defaults to Friend).
Well, nothing was working for me except this worked...
Not a very good solution but you should try these steps