Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 889834 - Last Review: December 3, 2007 - Revision: 3.5
The DateTimePicker and MonthCalendar control do not reflect the CurrentUICulture property of an application's main execution thread when you created a localized application in the .NET Framework, in Visual Studio 2005, or in Visual Studio .NET
SYMPTOMS
You add a
DateTimePicker control and a
MonthCalendar control to your Microsoft Windows Forms application. Your
operating system's calendar is set to English (
en_US).
However, you set the
CurrentUICulture property of your thread to French (
fr_FR). The
following behavior occurs:
- The months are displayed in English.
- The short date format is
month/day/year.
The
DateTimePicker control and the
MonthCalendar control do not reflect the
CurrentUICulture property of the application's main execution thread as you
expected when you created the localized application.
In the following
Microsoft Visual Basic 2005 or Microsoft Visual Basic .NET example, when you
set the
CurrentUICulture property to
fr_FR, the
DateTimePicker control and the
MonthCalendar control do not display their user interface in French:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("fr")
System.Threading.Thread.CurrentThread.CurrentUICulture = System.Threading.Thread.CurrentThread.CurrentCulture
End SubCAUSE
This behavior occurs because the
DateTimePicker control and the
MonthCalendar control are Microsoft Windows common controls. Therefore, the
operating system's user locale determines the user interface of these
controls.
RESOLUTION
To change this behavior, change the user locale calendar
settings in Control Panel. To do this, follow these steps:
- Click Start, click Control
Panel, and then double-click Regional and Language
Options.
- In the Regional and Language Options
dialog box, select an item in the Select an item to match its
preferences, or click Customize to choose your own format section to
select the locale that you want the control to use.
- Click OK.
MORE INFORMATION
For more information about the
DateTimePicker control visit the following Microsoft Developer (MSDN) Web site:
For more information about the
MonthCalendar control, visit the following MSDN Web site:
APPLIES TO
- Microsoft .NET Framework 2.0
- Microsoft .NET Framework 1.1
- Microsoft .NET Framework 1.0
- Microsoft Visual Studio 2005 Standard Edition
- Microsoft Visual Studio 2005 Professional Edition
- Microsoft Visual Studio .NET 2003 Professional Edition
- Microsoft Visual Studio .NET 2003 Enterprise Architect
- Microsoft Visual Studio .NET 2003 Enterprise Developer
- Microsoft Visual Studio .NET 2003 Academic Edition
- Microsoft Visual Studio .NET 2002 Professional Edition
- Microsoft Visual Studio .NET 2002 Enterprise Architect
- Microsoft Visual Studio .NET 2002 Enterprise Developer
- Microsoft Visual Studio .NET 2002 Academic Edition
| kbvs2005swept kbvs2005applies kbwindowsforms kbcontrol kblocalization kbtshoot kbinfo KB889834 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate
Be the first to leave feedback, to help others about this knowledge base
article.
(Optional) Name
(Optional)
Public URL Or Email
Comments
No
HTML -- Text Only Please