I have just created an own control. I know how to include it into the toolbox. But I would like my control have a specific icon in the toolbox. How can I do it?
Printable View
I have just created an own control. I know how to include it into the toolbox. But I would like my control have a specific icon in the toolbox. How can I do it?
Easy . First your image should be 16X16 with color of 16bit . Then add that as resource file . Change Build action as embedded resource. After that , add this attribute to your class . like so :
[ToolboxItem(true)]
[ToolboxBitmap(typeof(myprojectname))]
public class blah : foo .
that's all .
For distributive purposes, Pirate's method is the one you want. For your own in-house use, just include a bmp with the same name as the class of your control. The IDE will automatically pick it up.