Hi guys,
I use visual studio 2017 to develop a grasshopper component for rhino 6. Now I can’t add an icon to my component. It is easy to repeat my problem. I just use the project template to create a new component. After that I add one image file 24x24 and the same size icon image to the project.
Could anyone tell me how to get the icon for the component?
In the following sample snippet, I can see what I should do:
/// <summary>
/// Provides an Icon for every component that will be visible in the User Interface.
/// Icons need to be 24x24 pixels.
/// </summary>
protected override System.Drawing.Bitmap Icon
{
get
{
// You can add image files to your project resources and access them like this:
//return Resources.IconForThisComponent;
return null;
}
}
But no way I can access the image file, I have tried Resource.iconfile or projectname.Resource.iconfile.
It works fine in vs 2022 for rhino 7, but it doesn’t work here.
thank you.
Regards
Eric