C# component icon

This will tell you how stupid I am with C# plugins : I can’t even assign an icon to a component.
I’m trying to be a good boy and do exactly what the template file tells me, but even that will throw an error in my face !

So what’s the deal here ?

Is your icon in “Project → Properties → Resources”?
image

You need to compile icons into a Resource file.

1 Like

My icon is in “Project → Resources”, as shown in this tutorial.

Ugh… yet another explanation.
So how exactly do I go about and do that ?

1 - Test “BlockTools.Ressources.Icon1” instead of “Resources.Icon1”?

2 - With
image

Do you have something like this in “Resources.Designer.cs”

Otherwise, close VS, delete “Resources.resx” and “Resources.Designer.cs”, open VS and add your resource image again (to re-generate this file)

Nope. Doesn’t work.

I have this :

Yeah, I guess I’ll try that, thanks.

I’m amazed at how convoluted such a simple task is with C#…

Sorry ! test: “BlockTools.Properties.Resources.Icon1”

Good your resource is found!

Now show me the screen of your

You must add your resource in “Images” and not in “Icons”

Yes the bad thing about C # is the project file

Sorry, I’m completely lost.
As I told you, I followed the video tutorial … et voilà.

I don’t know how to get this display …Libx* ? What’s that ?

image

look at the difference

  • Your project:
    image

  • My project
    image

it is my project !!

Wait, wait I got it : Libx is the name of your project, so you are talking about this :
Now I get it

OK, but that was done automatically. As I told you, I just followed the darn video !
So basically, somehow, my icon is of the type “Icon” instead of being an image.
Duh…

1 - remove this Icon
2 - change the tab “Icons” by “Images”

image

3 - append your image

4 - We ignore the video here :slight_smile:

Yeah, there’s something fishy with that video.
In fact, he doesn’t go on and reference the icon in the component.

Thanks.
I’ll be back if I prove to be completely hopeless.

It actually really isnt…add a new item of type resource, double click that and click on “add resource”, done.