Put your icon (for exemple "icon.bmp" 16x16 pixels) on the root folder of your custom control project
Include this line just before your control class : [ToolboxBitmap(typeof(yourControl), "yourControl.bmp")]
Here are further steps you need to take care of:-
Verify your bitmap has the following properties :
Height of 16 pixel
Width of 16 pixel
Bitmap saved as 16 colors bmp file
Give it the same name as the class of your custom control (ie : yourControl.bmp)
Place it in the same directory, and then make it an embedded resource of your assembly.
To enable the bitmap as an embedded resource, right-click the bitmap file and select the Properties menu item. From the Properties page, set the Build Action to Embedded Resource.
So when you will place your control in a page, the Toolbox will search the assembly manifest for an embedded bitmap with the same qualified name as the control, here is the reason why the bitmap must have the same name as the class of your control.
For further discussion on this you can refer to this
So I have another noodle-scratcher (for me anyway).
I'm trying to create my own custom control in a CMS I only have partial source code for (i.e. samples the vendor has supplied to me). Basically I have created a …
I am trying to create a simple user control that is a slider. When I add a AjaxToolkit SliderExtender to the user control I get this (*&$#()@# error:
Server Error in '/' Application. The Controls collection cannot be modified …
I have a DataTable which has 5 columns:
ID
Name
Account Number
Branch
Amount
The DataTable contains 5 rows.
How can I show the sum of the Amount Column in a Label Control as "Total Amount"?