Reputation: 2160
I can't reference the images in my VS resources directory.
Based on what I read here and here I do it like this:
MyProject.Properties.Resources.Append_16x16
And then I set the build action to "Compile".
But then this line fails at compile time:
this._appendToolStripButton.ImageTransparentColor = MyProject.Properties.Resources.Append_16x16;
The only files that I can access (they show up in IntelliSense) are the ones I didn't copy from another project.
Strange.
Upvotes: 0
Views: 77
Reputation: 2160
It turns out to reference images this way you have to R-click on that project's properties directory in the solution explorer, clicking "Open", click on the "resource" tab, and then hit "Add Resource".
See here.
This design of VS where you can add these files by R-clicking the Resources directory in the solution explorer, but the path reference won't work is poor.
Upvotes: 1