Al,
You can use the Icon's constructor overload that accept a Type and a
resource name. The type needs to be declared in the assembly where the
resource is. The constructor uses the type for 2 pieces of information:
assembly and namespace, so the type and the resource needs to be under the
same namespace in the same assembly.
Other possiblility is to use Assembly.GetManifestResourceStream to get a
stream with the resource data and load it from there. This is BTW what
internaly the Icon constructor uses.
From experience I can tell that the tricky part is to get the resource
namespace right. VS IDE for C# puts all the resources under the default
namespace (property of the project) and then it appends the names of any
subfolder that the file might be in. VB's IDE works differently. If you have
problems loading the resource I'd suggest to use the reflector tool to check
out what is the correct namespace of the resource.
--
HTH
Stoitcho Goutsev (100)
"Al" <Al@discussions.microsoft.com> wrote in message
news:61**********************************@microsof t.com...
Hi,
I have created a solution with two projects in it - a class library and a
windows forms front end. I have added a resource file (Resources.resx) to
the
class library and filled it with icons.
Does anybody know how would I go about using an icon from this resource
file
in the windows forms project?
Thanks in advance,
Al.