I woudl like to set the culture for my whole application. I tried the following :
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(wanted
I know the topic is old but I found myself in a "thread with OS culture" problem.
I solved it so: as the BackgroundWorker is in a UserControl (it would be valid if it is in a Form and so on...) I set a field in the UserControl (or Form) when it is constructed. In the DoWork event handler I use this field in my operations. Here the code:
///
/// Culture in which the GUI creates the control.
///
private readonly CultureInfo _currentCulture;
///
/// Default constructor.
///
public MyControl()
{
InitializeComponent();
_currentCulture = CultureInfo.CurrentUICulture;
}
private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
{
ExampleClass.DoCultureDependentOperation(_currentCulture);
}