Setting the VS ToolBox Icon for my control

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,530
Location
Lansing, MI; USA
Programming Experience
10+
I've been reading up on this and it seems I'm not understanding something to make this work.

It seems that the ToolBoxBitmap() isn't picking up the image I specify (which is a 16x16 bmp and is part of the project) and I'm at a loss to why.
 
Add the Bitmap to the project via 'Add Existing Item', set these properties:
Build Action = Embedded Resource
Copy to Output Dir = Do Not Copy

Then set the compiler tag of your class to include this:
VB.NET:
Expand Collapse Copy
<ToolboxItem(True), ToolboxBitmap(GetType([U]Name Of Class[/U]), "[U]Name of Image w/ extension[/U]")>
 
Back
Top