How can I add control's icon on VS IDE's toolbox
-
I develop a dialog inherit ..Form and then make it to a DLL file. but I can not add this dialog's icon in toolbox, it said had none componets needed to add on the toolbox. I change this class inherit in ..Controls or in System.ComponentModel then it can add a icon which like a gear wheel, but if it inherit by ..Form then it can't work. My target want to build a dialog component like ..PrintDialog that it can show icon on toolbox and can drag to nonvisible component area. I wonder if ..Form's designer prevent the inherit form component add as a control..., but why ..PrintDialog which inherit by ..Form can? :confused: === Game is power! ===
-
I develop a dialog inherit ..Form and then make it to a DLL file. but I can not add this dialog's icon in toolbox, it said had none componets needed to add on the toolbox. I change this class inherit in ..Controls or in System.ComponentModel then it can add a icon which like a gear wheel, but if it inherit by ..Form then it can't work. My target want to build a dialog component like ..PrintDialog that it can show icon on toolbox and can drag to nonvisible component area. I wonder if ..Form's designer prevent the inherit form component add as a control..., but why ..PrintDialog which inherit by ..Form can? :confused: === Game is power! ===
It is handled in the class attributes. [ToolboxItem(true), ToolboxBitmap(typeof(myControl), "myControl.bmp")] public class myControl:UserControl You need to have Default Namespace set to the namespace of your control and you have to have the bitmap in the root of your solution. There are 10 kinds of people in the world.
Those that read binary...
...and those who don't. -
It is handled in the class attributes. [ToolboxItem(true), ToolboxBitmap(typeof(myControl), "myControl.bmp")] public class myControl:UserControl You need to have Default Namespace set to the namespace of your control and you have to have the bitmap in the root of your solution. There are 10 kinds of people in the world.
Those that read binary...
...and those who don't.At first, thanks for you help.:rose: I do what you said, it works well, the icon that can be showed on toolbox. But when I drag the icon to the designer area and then can not see it. it can not shows on 'nonvisible component area'(a bar at the bottom of designer), say nothing of 'visible area'. (But funny is it can be selected the component at the Property card :( ) === Game is power! ===
-
At first, thanks for you help.:rose: I do what you said, it works well, the icon that can be showed on toolbox. But when I drag the icon to the designer area and then can not see it. it can not shows on 'nonvisible component area'(a bar at the bottom of designer), say nothing of 'visible area'. (But funny is it can be selected the component at the Property card :( ) === Game is power! ===