Click here to Skip to main content
16,016,164 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,i create a component but i dont know how can i change the icon of my component
anyone can help me?
Posted

If you mean the icon in the Visual Studio ToolBox, include the following above teh class defintion line:
C#
[ToolboxBitmap(@"c:\MyIcon.bmp")]
You will find details on MSDN[^]
 
Share this answer
 
Comments
RaisKazi 4-Aug-11 7:43am    
Perfect. 5!.
You can use ToolboxBitmap attribute to accomplish this task. as
[System.Drawing.ToolboxBitmap ( @"C:\YourIcon.bmp" )]

Reference Link :- How do I add a ToolboxBitmap to a C#[^]
 
Share this answer
 
v2
Comments
RaisKazi 4-Aug-11 7:43am    
Perfect. 5!.
ali_vampire 4-Aug-11 8:17am    
Attribute 'System.Drawing.ToolboxBitmap' is not valid on this declaration type. It is only valid on 'class' declarations.
RaviRanjanKr 4-Aug-11 8:31am    
Well I've not tried it. but This Link-[ http://support.microsoft.com/kb/311315 ] might help you to learn how and where to use custom Toolbox icon.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900