By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,671 Members | 1,623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,671 IT Pros & Developers. It's quick & easy.

Adding resource files to a form or user controle

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.