I'm making a control for Visual Studio, and I want to give it an icon to see in the toolbox.
I can easily make it happen when pointing at a location on the hard disk, like this:
[ToolboxBitmap("G:\Graphics\icon.png")]
But I don't want to depend on some folder, I want to embed 'icon.png' as a resource and use it from there.
I have the image embedded, and it works when using it in the control i.e. as an image in a picturebox, but does not when it comes to the ToolBoxBitmap:
I have run an ildasm.exe on the dll-file, and the manifest adresses the image like this:
I have tried to use the plain address from the manifest (as suggested on other websites and questions about this):
[ToolboxBitmap("DemoIconInToolBox.icon.png")]
But still to no avail.
I still only get the standard-icon in the toolbox (This is an other form, made to test the control):
Can anyone tell me what I am doing wrong?
This is taking place on a Win10 Pro, Visual Studio 2022, C# Forms.
Sincerely / Best regards