I cannot figure out, or google an answer, why pulling an image from project resources this way doesn't work:
Dim MIIcon As Image
Dim obj As Object = My.Resources.ResourceManager.GetObject("Item22") 'file: "Item22.png"
MIIcon = DirectCast(obj, Image)
Me.PictureBox2.Image = MIIcon
The obj is nothing. Neither it works with file extension included. While this (direct path) works (but it wouldn't when deployed, of course):
Dim MIIcon2 As Image
MIIcon2 = Image.FromFile("C:\Users\****\documents\visual studio \Projects\******\Resources\Item22.png")
Me.PictureBox3.Image = MIIcon2
Did I missed something? I must have done that couple of times in past. This test code is run at Form1_Load() event. Obviously, I can see the Item22.png in my resources in VS.
EDIT
I added the sample image using Visual Studio: Project Resources context menu -> Add... -> Existing item