1

I've got a project with some resource files which contain png-images. I want to use these images in the winforms designer to set the image-property of various ToolStripMenuItems. The problem is, the designer does not show any resources except the ones in the standard resource file (Properties.Resources.resx).

I noticed that in the "Select Resource" dialog there is e dropdownlist to select the resource file, but it shows only the standard resource file and none of the other resource files i've added.

So how can I get the WinForms Designer to recognize my resource files?

I am aware that simply moving all my resources to the Properties.Resources.resx file would work, but that is not an answer to my question.

I am using Visual Studio 2017 Professional.

Designer

Reza Aghaei
  • 120,393
  • 18
  • 203
  • 398
user3700562
  • 693
  • 11
  • 23
  • [How to add a resource file to Visual Studios so that it's visible in “Select Resource” dialog?](https://stackoverflow.com/q/37444859/3110834) – Reza Aghaei Jun 24 '18 at 19:15
  • @RezaAghaei so its not possible? I don't want dozens of .resx files in the root directory of my project. – user3700562 Jun 24 '18 at 19:18
  • 1
    No easy way. You may want to dig into the internal implementations to do [something like this](https://stackoverflow.com/a/47615439/3110834). There's a `ResourcePickerDialog` which asks from `ResourcePickerService` about resource files. The default (internal) implementation returns what I mentioned in the linked post. – Reza Aghaei Jun 24 '18 at 19:27
  • 1
    Also in [this post](https://stackoverflow.com/a/36096989/3110834), you can find how to register a `UITypeEditor` for a `Type` in visual studio. – Reza Aghaei Jun 24 '18 at 19:42
  • @RezaAghaei I was hoping there was a more straight-forward way to do something simple like this, but I guess not. Thank you very much for the insight though, I'll look into it. – user3700562 Jun 24 '18 at 20:47

0 Answers0