C# .net windows 形式的波斯日期时间选择器

sab*_*aba 5 c# datetimepicker winforms jalali-calendar

我想在 Windows 窗体 C#.net 中从用户那里获取日期时间。我使用 .net 控件的 datetimepicker 但它是 gregorian 所以我怎样才能将此 datetimepicker 更改为 shamsi 日期??? winform中的DatetimePicker图像

小智 -1

不需要额外的库。您可以在控制面板的“区域设置”中更改压光机类型。并在之后添加这些行InitializeComponent();

Application.CurrentCulture = new CultureInfo("fa-IR");
dateTimePicker1.Format = DateTimePickerFormat.Custom;
dateTimePicker1.CustomFormat = Application.CurrentCulture.DateTimeFormat.ShortDatePattern;
Run Code Online (Sandbox Code Playgroud)