473,320 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 5716
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Filips Benoit | last post by:
A particular form - always the same - sometimes becomes corrupt after saving. Error msg = The expression On Open you entered as the event property settings produced the following error: A...
1
by: | last post by:
hi, can some one tell me snip code to get reference to web user controle (.ascx form) aspx "table" and its rows & cells. regards Sam.
7
by: Wysiwyg | last post by:
Is there any way to add an embedded resource to a project without copying it to the project's directory? I have shared resources and don't want each project using the images, xml files, etc. to...
2
by: Don Tucker | last post by:
Hello, I have a Windows Application that needs to load multiple image files in response to users clicking buttons. Currently, I just have these images as .jpg files on disk, but I don't want to...
1
by: Gabriel Lozano-Morán | last post by:
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...
11
by: Alan T | last post by:
I added a resource file into my project, to store the caption of buttons and labels.. How do I make use of this resource file to dynamically assign to the buttons and labels ?
4
by: TCook | last post by:
Hey All, I am building a solution which will have many strings that will need to be localized (i.e. strings for toolbars, strings for different WinForms, strings for messages and error messages,...
7
by: Rich | last post by:
I am resurrecting this question (since it got bumped down by more recent posts). This is probably very simple - I need to add a version resource to a DLL project in MSVC++ 2005 Express in order...
5
by: DBC User | last post by:
I have a situation, where I need to add 4 or 5 data files (they change every time I build) in my project during build time and somehow I need a way to access these files during runtime. So I have...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shćllîpôpď 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.