DateTimePicker - Howto set the language

  • Thread starter Thread starter Josef Brunner
  • Start date Start date
J

Josef Brunner

Hi,

I have an application that enables the user to switch between (so far) 2
different languages.

Now I need to display a datetimepicker. How can I switch / control the
language the datetimepicker appears?

I tried doing this to set it to english, but it would still display the
control using the german language:
System.Threading.Thread.CurrentThread.CurrentUICulture =
System.Globalization.CultureInfo.GetCultureInfo("en-GB")

Thank you very much,

Josef
 
Josef,

Josef Brunner said:
I have an application that enables the user to switch between (so far) 2
different languages.

Now I need to display a datetimepicker. How can I switch / control the
language the datetimepicker appears?

I tried doing this to set it to english, but it would still display the
control using the german language:
System.Threading.Thread.CurrentThread.CurrentUICulture =
System.Globalization.CultureInfo.GetCultureInfo("en-GB")

I assume this needs to be done prior to instantiating the form. However, I
am not sure if it will work on non-MUI versions of Windows at all.
 
Hi Herfried,

Herfried K. Wagner said:
I assume this needs to be done prior to instantiating the form. However,
I am not sure if it will work on non-MUI versions of Windows at all.

I tried to chang the Culture before instantiating the form...still no luck.
I guess I have a non-MUI version of Win XP...hhmmm

Thanks anyway,
J
 
Josef,

I never succeeded in any control or error message to show it in another
culture than the installed OS or/and Net
(Not so strange because in that part is the text that is needed).

(There is not even a Net version 2.0 in most languages, at the moment there
are only something as 8 so by instance we in Belgium and Holland have to do
with texts like "There is a fout geconstateerd in" it is not as bad as this
however I have sometimes that idea ).

:-)

http://www.microsoft.com/downloads/...cb-4362-4b0d-8edd-aab15c5e04f5&DisplayLang=en

Cor
 
Cor,

Cor Ligthert said:
I never succeeded in any control or error message to show it in another
culture than the installed OS or/and Net

:)
Thanks for the info. To solve this, I guess I will have the user input the
date into a TextBox and then I'll try to use the DateTime.TryParse function
to validate whether the given string is a valid date...

Joe
 
Hi Joe,

As a workaround, you can install Multilanguage Pack firstly and then choose
the language in menus and dialogs in "Regional and Language Options". This
will make the UI display the relevant language.

I hope this information is also helpful for you. Thanks and have a nice day!

Best Regards,

Terry Fei [MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security


--------------------
From: "Josef Brunner" <[email protected]>
References: <[email protected]>
<[email protected]>
 
Back
Top