views:

67

answers:

2

In my WinForms applications I often put the controls text data (form title, labels texts, button captions, etc.) into a .settings (feature automatically generated by Visual Studio - based on the ApplicationSettingsBase class). In particular,

  1. Add a form or a control.
  2. In Solution Explorer add a new string item into the application scope of the settings file.
  3. Bind the control text property with the corresponding item of the settings file (through the property binding).

Good point of this is that all my text data is collected in one place and easy to check and edit. Also it is convenient when I want to use the same text for several controls.

However, I haven't heard that somebody uses the .settings such way. In tutorials for creating multilingual applications, for example, it is recommended to enter texts directly into the control property.

So, is it good practice to use .settings for storing controls text data?

Brief conclusion from the answers:
Storing controls text data in the .settings is not common practice.

+1  A: 

This kind of data belongs in the application's resource file(s). That way they can be localized.

John Saunders
+2  A: 

Use the settings to remember things for the user, like window size, location, state (minimized, maximized, normal), currently selectedItem of comboboxes, checked state of checkboxes, etc. Things that can be bound and automatically reset for the user the next time he/she runs the program.

Button text belong in resource files to simplify localization if needed.

Stomp
The user scope is exactly for that. However my question is what is the application scope used for, if not for storing the controls text data?
Zenya
@Zenya - The application scope is used for settings like a database connection string, a url, stuff that an admin might need to change but that the user has no real need to even know about.
Stomp
@Oliver - That would be double storing. Usually one can restore the default user settings by calling Settings.Default.Reset() or accessing the DefaultValue properties of the Settings class. There is a good article on this: http://www.codeproject.com/KB/dotnet/user_settings.aspx
Zenya
There a missing comment here? kinda curious re the context of your comment to Oliver...
Stomp
Yes, the comment, to which I replied, seemed to be deleted.
Zenya