开发者

VB.NET: My.Resources.{VARIABLE}

开发者 https://www.devze.com 2023-02-02 22:29 出处:网络
So I can access an image by My.Resources.ImageName.......... But, that is manually-coded. What I want is to have my image name saved in a variable, lets cal开发者_运维问答l it VAR.

So I can access an image by My.Resources.ImageName..........

But, that is manually-coded.

What I want is to have my image name saved in a variable, lets cal开发者_运维问答l it VAR. VAR = "IMAGE1.png"

So I can do something like

My.Resources.VAR which will return the IMAGE1.png image.

Is that possible?


My.Resources.ResourceManager.GetObject(var)


Declare:

Dim imag as Image
imag = My.Resources.foto
PictureBox1.Image = imag

That's it, the image (photo) will appear on the PictureBox1

0

精彩评论

暂无评论...
验证码 换一张
取 消