468,107 Members | 1,303 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,107 developers. It's quick & easy.

Adding resource files to a form or user controle

First of all sorry for the cross-posting but I am not sure wether this
belongs under internationalization or just general.

Environment:
Visual Studio .NET 2003

Problem:
Newly added and renamed resource files are not automatically linked to the
object they belong by the IDE

Steps to reproduce:
1) create a new C# or VB.NET Windows application, you will have a standard
form named Form1.cs/Form1.vb
2) add a new resource file and name it Form1.nl-BE.resx
3) you will see that the resource file is at the same level as the Form1
meaning that it is not linked by the IDE to Form1

Workaround:
4) now using Windows Explorer move the Form1.nl-BE.resx to another folder
5) refresh the project in Visual Studio IDE
6) Form1.nl-BE.resx will be marked as missing, remove the file
Form1.nl-BE.resx from the project
7) move the Form1.nl-BE.resx back to the same folder as Form1.cs
8) refresh the project
9) show all files
10) you will see that the Form1.nl-BE.resx resource file has been linked to
Form1 and has become a child node of Form1
11) include the Form1.nl-BE.resx in the project

Question:
Why doesn't the IDE automatically link the resource file to the Form1 when
you first add it to the project?

Regards

Gabriel Lozano-Morán
Sep 9 '05 #1
1 4104
Gabriel,

I could not reproduce your workaround. Even after moving and removing the resource-file (.resx) stays besides the Form

And I think this is logical. In Solution Explorer you add a resources-file to the project, not to the Form. What if your project
contains several Forms?

Besides, you don't have to "link" the resource-file to a certain form. As long as you follow the naming conventions you can access
the content of the resource-file out of the generated satellite-assemblies from anywhere within your project.

Regards
Rolf

"Gabriel Lozano-Morán" <ga************@no-spam-thx.org> schrieb im Newsbeitrag news:%2****************@TK2MSFTNGP12.phx.gbl...
First of all sorry for the cross-posting but I am not sure wether this
belongs under internationalization or just general.

Environment:
Visual Studio .NET 2003

Problem:
Newly added and renamed resource files are not automatically linked to the
object they belong by the IDE

Steps to reproduce:
1) create a new C# or VB.NET Windows application, you will have a standard
form named Form1.cs/Form1.vb
2) add a new resource file and name it Form1.nl-BE.resx
3) you will see that the resource file is at the same level as the Form1
meaning that it is not linked by the IDE to Form1

Workaround:
4) now using Windows Explorer move the Form1.nl-BE.resx to another folder
5) refresh the project in Visual Studio IDE
6) Form1.nl-BE.resx will be marked as missing, remove the file
Form1.nl-BE.resx from the project
7) move the Form1.nl-BE.resx back to the same folder as Form1.cs
8) refresh the project
9) show all files
10) you will see that the Form1.nl-BE.resx resource file has been linked to
Form1 and has become a child node of Form1
11) include the Form1.nl-BE.resx in the project

Question:
Why doesn't the IDE automatically link the resource file to the Form1 when
you first add it to the project?

Regards

Gabriel Lozano-Morán

Sep 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Don Tucker | last post: by
1 post views Thread by Gabriel Lozano-Morán | last post: by
11 posts views Thread by Alan T | last post: by
4 posts views Thread by TCook | last post: by
5 posts views Thread by DBC User | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.