Re: Resources help

"Fellows, William B." <[email protected]> Fri, 16 Mar 2007 08:51:12 -0400
Newsgroups gmane.comp.windows.devel.dotnet.cx
Message-ID <973411582584714AB0D1B4876826229D388B39@xmbv3801>
Peter,

If I understand your needs correctly, this might be what you're looking
for:

In the properties for the icon, set build action to 'Embedded Resource'.
This allows it become an integral part of your assembly. Now, whenever
you want to use it, do something like the folling:

Assembly myAssembly = Assembly.GetExecutingAssembly();
Icon myIcon = new
Icon(myAssembly.GetmanifestResourceStream("MyNameSpace.MyIconName.ico");


- Bill
 
-----Original Message-----
From: Discussion relating to the specifics of the C# and Managed C++
languages [mailto:[email protected]] On Behalf Of Peter
Osucha
Sent: Thursday, March 15, 2007 4:32 PM
To: [email protected]
Subject: [DOTNET-CX] Resources help

I have been reviewing the MSDN articles for some time on using resources
in a C# application.  The MSDN links seem to be quite circular - I'm
learning a lot but getting nowhere.  Any better place to learn about how
resources can be accessed/interacted with within an app?  (eg, I create
an icon file in my project that I want to use as either a form icon, or
as an image in an ImageList control - how can I do that?)

 

Peter

 


===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com