Ronen
Ronen

Reputation: 61

Changing the default culture info of my Application

Each thread inherits the default Windows culture unless you change it by accessing the current thread through services provided by the System.Threading namespace.

Do you know if it possible to change the default Application culture info instead of setting eac new thread with the culture info of its parent.

Thanks! Ronen

Upvotes: 4

Views: 1501

Answers (3)

Geoffrey
Geoffrey

Reputation: 976

In .NET 4.5 the CultureInfo.DefaultThreadCurrentUICulture property was added which changes the cultureinfo of all threads in a given AppDomain. Setting this property in the static constructor of your form should usually do the trick.

MSDN reference

Upvotes: 1

PradeepGB
PradeepGB

Reputation: 314

I agree with nukefusion. you have to change the culture every time thread gets initialized.

Upvotes: 2

Matt B
Matt B

Reputation: 8653

Unfortunately there's no application-wide setting for the default culture for new threads. The default culture of a thread is set by Windows when it is created.

Upvotes: 2

Related Questions