How to Add Resources to Windows Forms 
Author Message
 How to Add Resources to Windows Forms

Hello,

    I want to add a couple of images manually to the resource file
associated with a windows form. How can i do it

any help appreciated.

Thanks,

Narra



Tue, 24 Aug 2004 01:40:21 GMT  
 How to Add Resources to Windows Forms
Gavi,

The simplist way is adding these images to a ImageList control. When you do this, these image are embeded into the .resx file associated with the form.

Alternatively, you can use an external resouce editor to add the images to the .resource or .resx file, and then embed it to the project by "Add Existing Item...". Make
sure to the  Build Action is set to "Embedded Resource". You can use a ResourceManager to retrieve these images from the assembly and use them in your
application.

As to the resource editor, there's a reseditor sample in the FrameWork SDK (FrameworkSDK\Samples\tutorials\resourcesandlocalization\reseditor). You need to
compile the sample before using it.

In addition, you can embed these images to the assembly directly using "Add Existing Item...". To retrieve these directly embedded resource, you need to use
GetManifestResourceStream method to load the specified manifest resource from this assembly and cast the stream to appropriate type.

I hope this helps.

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.

Need quick answers to questions like these? The Microsoft Knowledge Base provides a wealth of information that you can use to troubleshoot a problem or answer a
question! It's located at http://support.microsoft.com/support/c.asp?M=F>.

--------------------

Quote:

>Subject: How to Add Resources to Windows Forms
>Date: Thu, 7 Mar 2002 12:40:21 -0500
>Lines: 12
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

>Newsgroups: microsoft.public.dotnet.languages.CSharp
>NNTP-Posting-Host: 208-58-108-43.c3-0.wsd-ubr1.qens-wsd.ny.cable.rcn.com 208.58.108.43
>Path: cpmsftngxa09!tkmsftngxs01!tkmsftngp01!tkmsftngp04
>Xref: cpmsftngxa09 microsoft.public.dotnet.languages.csharp:44223
>X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

>Hello,

>    I want to add a couple of images manually to the resource file
>associated with a windows form. How can i do it

>any help appreciated.

>Thanks,

>Narra



Tue, 24 Aug 2004 18:47:35 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Adding Timer Control to Windows Form???????

2. Adding Help to a Windows Forms App

3. Adding forms under windows 2000

4. Adding forms under windows 2000

5. How to disable adding, inserting ord deleting Rows in the DataGrid (System.Windows.Forms.DataGrid)

6. Cannot add new resource font at Windows 3.1

7. Adding columns to ListView after it's been added to a form

8. Make Windows Form Application with VC++.NET 2002 using a visual form

9. System.Windows.Forms.Form

10. system.windows.forms.form.show()

11. classes that inherit from Windows.Forms.Form - problem with View Designer

12. Displaying XML in a System.Windows.Forms.Form control

 

 
Powered by phpBB® Forum Software