Question How can I access the resources of a project through a custom "uitypeeditor" which is located into a control library?

simos-sigma

New member
Joined
Nov 17, 2022
Messages
2
Location
Athens, Greece
Programming Experience
5-10
Hello!!! :)

I am trying to make a custom UITypeEditor with a dialog box which will import .svg files into a project or will select one from those already imported, like the Select Resource Dialog Box does with other files.

I have managed to make it get the .svg file from a file and then place it to my custom control. What I want to do now is to have the ability to select imported .svg files from the resources of the project where my control library will added to.

Untitled-2.jpg


I tried something like this...

C#:
var images = typeof(Properties.Resources).GetProperties(BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public)
    .Where(p => p.PropertyType == typeof(Bitmap))
    .Select(x => new { Name = x.Name, Image = x.GetValue(null, null) })
    .ToList();

...but I am getting the resources of the control library project and not the resources of the project where my control library is added to!!!

Any idea how can I achieve that?

Thank you for your time in advance!!!
 
As far as I know the resources are only put into the assembly at compile time. So trying to pull the resources before the assembly has been compiled is probably not a good idea. I don't know enough about the VS SDK on how you can navigate through the project and get to the resources files.
 
I don't know. I do not use the WinForms Designer.
 

Latest posts

Back
Top Bottom