Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
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 image 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.

An image image of my custom dialog box.

What I have tried:

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?
Posted
Comments
[no name] 17-Nov-22 18:54pm    
I found I needed to add a "resource reader" (class) to each resource dll I wanted to share / extract from; trying to read from another .exe or .dll didn't work. Didn't look too hard for alternatives though.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900