Persian datetimepicker in C# .net windows form

saba picture saba · Oct 18, 2016 · Viewed 7.9k times · Source

I want to get datetime from user in windows form C#.net .I use datetimepicker of .net control but it is gregorian so how can I change This datetimepicker to shamsi date??? DatetimePicker image in winform

Answer

im_shidi picture im_shidi · Oct 2, 2019

Previously I tried Behrooz Moghaddam's code but using the default winforms DateTimePicker control, but that code didn't work.

Now I am using the telerik RadDateTimePicker and write this code after InitializeComponent() and instead of "fa-IR" use your culture.

Application.CurrentCulture = new CultureInfo("fa-IR");
radDateTimePicker1.Format = DateTimePickerFormat.Custom;
radDateTimePicker1.CustomFormat = Application.CurrentCulture.DateTimeFormat.ShortDatePattern;