Decrease Font Size
Increase Font Size
   BLOG

Individualizing the Control: Add a custom toolbox icon for the control

Individualizing the Control: Add a custom toolbox icon for the control

How to add icon to custom server control

  1. Create an icon from any of the links below. This is free.

    genfavicon

    dynamicdrive

  2. What is the name of your class? For instance my class name is TextScroller

    public class TextScroller : WebControl, INamingContainer
    

    Named the icon TextScroller.ico. Place it in the project root directory and change the Build Action to Embeded Resource

Embed Icon

Adding the Control to the Toolbox

Go to View, Toolbox, Right click any place in the Toolbox, Add Tab, I name it MyTextScroller.

Right click MyTextScroller, Choose Items, .NET Framework Components Tab, Browse, find the MyTextScroller.dll, click Ok.

You should see the custom icon next to the control instead of the default icon.

Custom Icon