I am using Visual Studio 2010, C# and WinForms and have created custom component like this:
public partial class SlidePanel : Panel
{
some code here...
}
So it is a component class not a user control.
What I want is when I drag my component on the windows form to get an icon representing my component below the form. An example would be the existing binding source control – when you add it to form it gives you an icon below the form (on form designer) which you can select and then change properties. How can I do this? The icon can be a generic one.
No, it is neither. It’s still a panel control, you just customized its behavior. If this class is in a project in your solution then you’ll automatically get it added to the toolbox after you compile. At the top, right after the arrow. If that doesn’t happen then you have a setting wrong. Tools + Options, Windows Forms Designer, General, ensure that AutoToolboxPopulate is set to True.
If you actually want what you describe (icon added at bottom) then you need to create a class that derives from Component. Which is a very different kind of animal, it cannot have a visual representation on the form. It certainly can’t resemble anything like a panel. See this answer for an example.