[英]Persian datetimepicker in C# .net windows form
以前我嘗試過 Behrooz Moghaddam 的代碼,但使用默認的 winforms DateTimePicker 控件,但該代碼不起作用。
現在我正在使用RadDateTimePicker
並在InitializeComponent()
之后編寫此代碼,而不是"fa-IR"
使用您的文化。
Application.CurrentCulture = new CultureInfo("fa-IR");
radDateTimePicker1.Format = DateTimePickerFormat.Custom;
radDateTimePicker1.CustomFormat = Application.CurrentCulture.DateTimeFormat.ShortDatePattern;
不需要額外的庫只能在控制面板上的區域設置中更改壓延類型。 並在InitializeComponent()之后添加這一行;
Application.CurrentCulture = new CultureInfo("fa-IR");
dateTimePicker1.Format = DateTimePickerFormat.Custom;
dateTimePicker1.CustomFormat = Application.CurrentCulture.DateTimeFormat.ShortDatePattern;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.