VB.Net: Dynamically Select Image from My.Resources

前端 未结 5 714
忘了有多久
忘了有多久 2021-02-05 06:03

I have a group of images in my My.Resources. I want to select select images to display dynamically at run time. How do I do this?

\'Static (Compile time) Assig         


        
5条回答
  •  北荒
    北荒 (楼主)
    2021-02-05 06:32

    This works for me at runtime too:

    UltraPictureBox1.Image = My.Resources.MyPicture
    

    No strings involved and if I change the name it is automatically updated by refactoring.

提交回复
热议问题