Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change culture to a DateTimepicker or calendar control in .Net

How to set internationalization to a DateTimepicker or Calendar WinForm control in .Net when the desire culture is different to the one installed in the PC?

like image 762
Oscar Cabrero Avatar asked Oct 28 '08 01:10

Oscar Cabrero


People also ask

What is the purpose of VB net DateTimePicker control?

The DateTimePicker control allows selecting a date and time by editing the displayed values in the control. If you click the arrow in the DateTimePicker control, it displays a month calendar, like a combo box control. The user can make selection by clicking the required date.

Which control is used as a DatePicker?

The DatePicker control allows the user to select a date by either typing it into a text field or by using a drop-down Calendar control.

What is the use of DateTimePicker in the toolbox of Visual Studio?

A DateTimePicker allows the user to select dates and times.


2 Answers

It doesn't seem to be possible to change the culture. See this KB article.

like image 107
Jonas Lincoln Avatar answered Sep 23 '22 13:09

Jonas Lincoln


Based on previous solution, I think the better is:

dateTimePicker.Format = DateTimePickerFormat.Custom;
dateTimePicker.CustomFormat = Application.CurrentCulture.DateTimeFormat.ShortDatePattern;
like image 24
KaDim Avatar answered Sep 23 '22 13:09

KaDim