views:

241

answers:

2

I changed the Windows XP Regional and Language Options to French (Canada) [fr-CA]. I have resource files that are definied in my application (Windows Forms) for "fr-CA". My dates and numbers are changed to format for fr-CA but my resource file for fr-CA is not being used. The only way to get the resource file to be read is to explicitly set the following:

Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-CA");

How can I get the thread to pick up the local machine's settings?

A: 

Did you change the setting while the application is running? I'm pretty certain that setting is only read when the application starts unless you do something like you're talking about in code.

Lee
I added this code before the first form is called. It works when I add the code. It is when I don't add the code that it sets the thread to en-US.
+2  A: 

As the example in the MSDN states you can do it like this:

// Set the user interface to display in the same culture
// as that set in Control Panel.
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
andyp