Here is what I did:
- Added a user control (named UserControl1) to a normal windows application project.
- Added a bitmap (named UserControl1.bmp) to the same project.
- Opened the bitmap for editing, resized it to16x16, colored it a little, then saved and closed it.
- Clicked once on the bitmap in theSolution Explorer window, then changed the "Build Action" property in the properties window to "Embedded Resource".
- Opened the code editor forthe user control, then added the following attribute info prior to the definition of my class:
[System.Drawing.ToolboxBitmap(typeof(UserControl1))]
The icondid not automatically update in my toolbox after I did all that. So, I continued with this...
- I right-clicked on my toolbox and selected "Choose Items...".
- I scrolled through the list of .NET Framework Components until I found my UserControl1 in the list. I looked to see what directory it was pointing to and it was my "obj\Debug" folder.
- I unchecked my UserControl1item in that list, then clicked the "OK" button.
- My user control was removed from the toolbox.
- I right-clicked on my toolbox againand selected "Choose Items...".
- I clicked the "Browse" button and navigated to my "obj\debug" folder (for my project) and selected my application's executable in that directory.
- I clicked all the "OK" buttons to get back to my project, and my icon updated.
I'm not saying or recommending that the last portion above is the way to do it... but that's how I did it to get it to work.