How to make Visual Studio recognize multiple project resource files

I have a Windows project in Visual Studio 2010 in which I store all the images in the project resource file that Visual Studio created for me. However, it becomes cluttered, and I would like to split the images into several resource files whenever possible. I created a new resource file, but Visual Studio does not recognize it when I go to the form designer and try to change the image. The only file available under the available project resource files is MyProject \ Resources.resx. The one I just created does not exist.

Any idea why it doesn't appear? I tried putting the resource in the My.Resources namespace, and also changing the namespace, and I also made it public. It is still not displayed.

Select Resource screen

+6
source share
1 answer

There is only one default resource file in the project. You can add additional resource files to the project at any time, other than the default settings. Additional resource files will NOT be placed in the My Project folder. They will simply be added to the project, like other files.

You can link to these new resources in the same way as others. Instead of accessing resources through "My.Resources." You will find other resource files in the "My.Resources. [Resource File Name]" section.

EDIT: The resource file must be at the root of your project if you want to reference it using the PictureBox control.

Hope this helps you.

+7
source

Source: https://habr.com/ru/post/895286/


All Articles