basic - I can't use my resources in Visual Studio 2022 (vb.net) - Stack Overflow

admin2025-04-17  3

I use Visual Studio 2022 and Visual Basic. Not a pro but amateur programmer.

I am trying to add images to my project as a resource. Everything goes well and they seem to be included in my solution. But when I try to use them in code, the resource list is empty. If I write:

PictureBox1.Image = My.Resources.

It doesn´t list my resources at all. No matter how I name them or what file format they are.

I had no problems with 2019 version of Visual Studio.

I have tried to add files the same way as I did with VS2019 (Project-Properties-Resources). But it says that resource management is now handled directly by opening RESX file. And so I did. The Solution explorer shows that my images are in "Resources"-folder, but still I cant use them anywhere. Like Visual Studio was totally unaware that they even exist.

I have tried to re-install Visual Studio, installed it to another computer, build solution many times, different file formats for images.

Is there something I must click or change? Or is this fault with Visual Studio itself?

转载请注明原文地址:http://anycun.com/QandA/1744853565a88542.html