You are looking in wrong direction. This is not how .resx resources are designed. You can add resources at any level of you project structure, and the namespace will be different, because the code is automatically generated based with the namespace name built based on the base namespace of the application and this location.
So, getting a resource is way too simple. First thing to understand that a static property is generated for you. Create a resource file, add you icon to it. If is, by far, beneficial to have an icon in a separate file, not embed it in a resource. Even if you edited it in a resource, save it as a file and remove from resource. Add it using "Add existing file", say, "YourIcon.ico". Make sure the original icon is not a part of your project, to avoid duplicates. The add step will: 1) copy the file to some directory of your project (that's why you'll have to check for duplicates and avoid them), 2) add the file reference to the project file (and hence project structure, will show a node for it), 3) add a reference to the file to the resource file, 4) generate the code getting this this resource in a auto-generated file, which is shown in a structure of the project as a child node of the resource node.
The last item is the key one. Open this auto-generated file and take a look. You will find a
static property with the name similar to the name of the file, in this case,
YourIcon
with appropriate type, such as
Image
or
Icon
. Just use this property directly in your code, using its fully-qualified name (you can add the
using
declaration to your file, perhaps
alias.
If the type of the file is unknown to Visual Studio, the auto-generated property type will be
byte[]
; one of the way to use it would be putting the bytes a memory stream an reading the instance of the object from this stream.
I described the general approach you need to use in your cases. As to "My", this is something more specific. If you need to understand what is that, please read:
http://msdn.microsoft.com/en-us/library/bb531245.aspx[
^],
http://msdn.microsoft.com/en-us/library/8ffec36z.aspx[
^],
http://msdn.microsoft.com/en-us/library/6wkcc526.aspx[
^].
—SA