by bryian
21. July 2009 14:12
Individualizing the Control: Add a custom toolbox icon for the control
How to add icon to custom server control
-
Create an icon from any of the links below. This is free.
genfavicon
dynamicdrive
-
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
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.
