ToolBoxBitmap
-
I have created my own custom progressbar controls and i wish to assign them an icon for the toolbox. I have read everything i found on the net including the super http://www.bobpowell.net/toolboxbitmap.htm[^] The orginal idea was to assign as an icon the icon of
System.Windows.Forms.ProgressBar
but i have tried everything and I couldn't do it. So i decided to add a new icon. That also didn't work. Finally i decided to use theToolBoxBitmap("FILEONDISK")
constructor but that didn't work also. So two things are happening. 1)It doesn't work which is not probable 2)Something in testing is wrong. My test procedure has been. Cleaning the project, building in debug and then in a designer of a form looking the toolbox. Please if i'm doing something wrong tell me. Also If someone has the solution to pute the .net controls icon in mine please also tell me. Because it matters here are some details for the project Default namespace:MyComponents.Windows
Assembly Name:MyComponents.Windows
The control is located in Controls\ProgressBar.cs in the project dir MyComponents\Windows. Here is the class declaration{ [ToolboxBitmap(typeof(ResourceFinder), "System.Windows.Forms.ProgressBar.bmp")] public class ProgressBar:System.Windows.Forms.Control
ResourceFinder
is an internal class outside Namespace declaration. As i have understood this should be sufficcient. -
I have created my own custom progressbar controls and i wish to assign them an icon for the toolbox. I have read everything i found on the net including the super http://www.bobpowell.net/toolboxbitmap.htm[^] The orginal idea was to assign as an icon the icon of
System.Windows.Forms.ProgressBar
but i have tried everything and I couldn't do it. So i decided to add a new icon. That also didn't work. Finally i decided to use theToolBoxBitmap("FILEONDISK")
constructor but that didn't work also. So two things are happening. 1)It doesn't work which is not probable 2)Something in testing is wrong. My test procedure has been. Cleaning the project, building in debug and then in a designer of a form looking the toolbox. Please if i'm doing something wrong tell me. Also If someone has the solution to pute the .net controls icon in mine please also tell me. Because it matters here are some details for the project Default namespace:MyComponents.Windows
Assembly Name:MyComponents.Windows
The control is located in Controls\ProgressBar.cs in the project dir MyComponents\Windows. Here is the class declaration{ [ToolboxBitmap(typeof(ResourceFinder), "System.Windows.Forms.ProgressBar.bmp")] public class ProgressBar:System.Windows.Forms.Control
ResourceFinder
is an internal class outside Namespace declaration. As i have understood this should be sufficcient.You need also the [ToolboxItem(true)] attribute. In my tests for this I went crazy because it **seems** to work only if you reference the compiled dll and not with a reference to the project and this is not documented at all.
free .net reporting and gdi+ tools www.neodatatype.net
-
You need also the [ToolboxItem(true)] attribute. In my tests for this I went crazy because it **seems** to work only if you reference the compiled dll and not with a reference to the project and this is not documented at all.
free .net reporting and gdi+ tools www.neodatatype.net
This is what I'm using and still it doesn't work.
internal class ResourceFinder { } namespace MyComponents.Windows.Controls { [ToolboxItem(true), ToolboxBitmap(typeof(ResourceFinder), "System.Windows.Forms.ProgressBar.bmp")] //[ToolboxBitmap(typeof(ResourceFinder), "System.Windows.Forms.ProgressBar.bmp")] public class ProgressBar:System.Windows.Forms.Control
In the same solution there is the GUI in another project. O compile the control and VS2005 populates automatically the Toolbar. But the icon is wrong. -
This is what I'm using and still it doesn't work.
internal class ResourceFinder { } namespace MyComponents.Windows.Controls { [ToolboxItem(true), ToolboxBitmap(typeof(ResourceFinder), "System.Windows.Forms.ProgressBar.bmp")] //[ToolboxBitmap(typeof(ResourceFinder), "System.Windows.Forms.ProgressBar.bmp")] public class ProgressBar:System.Windows.Forms.Control
In the same solution there is the GUI in another project. O compile the control and VS2005 populates automatically the Toolbar. But the icon is wrong.Let's say that ResourceFinder is in the namespace MyDllNameSpace.Images, the default namespace of your assembly (see Assembly properties) is MyDllNameSpace, the bmp should be into Images subfolder (so that ResourceFinder namespace is equal to default namespace + bmp folder): ToolboxBitmap(typeof(ResourceFinder), "ProgressBar.bmp")]
free .net reporting and gdi+ tools www.neodatatype.net