VB.net/c# HowTo add bitmap's to your user controls
If you've ever created a user control, particularly an inherited control, you've noticed that the icon to the left of your new control in the toolbox is simply a gear. With the below code, you can add the icon from an existing control:
VB Code:
<ToolboxBitmap(GetType(System.Windows.Forms.TextBox))> _
Public Class TextBox
Inherits System.Windows.Forms.TextBox
End Class
or in C#
VB Code:
[ToolboxBitmap(typeof(Button))]
class MyControl1 : UserControl
{
}
more information can be found Here
Re: VB.net/c# HowTo add bitmap's to your user controls
I learned of another method too:
add a 16X16 BITMAP to the project and in the bitmap's property page, set the BuildAction to 'EmbeddedResource'...
This puts the bitmap in the assembly file and becomes part of the code. When you add the compiled .dll to your toolbox, the icon will automatically be there.
neat, huh?