How to set the toolbox bitmap of your windows user control

Ever wonder how to give your windows control a tool box bitmap?


  1. In VS.NET add a bitmap file to the project either by adding an existing bitmap or creating a new one
  2. Next right click the bitmap in the solution explorer and click properties. Make sure the property "Build Action" is set to "Embedded resource".
  3. Next create your custom control if you have not done so already
  4. Then add the fallowing attribute to the custom control you just created
<ToolboxBitmap(GetType(SampleControl), "NameOfBitmap.bmp")> _
Public Class SampleControl    
    Inherits System.Windows.Forms.UserControl 
End Class

Created by: X

Just another personal website in this crazy online world

Name of author Dean Lunz (aka Created by: X)
Computer programming nerd, and tech geek.
About Me -- Resume