我有2 DateTimePicker的就可以了,初始化爲WinForm應用程序的本地化顯示如下:「動態」定製的DateTimePicker格式
private void InitializeComponent()
{
...
this._StartDate.Format = System.Windows.Forms.DateTimePickerFormat.Short;
....
// Note: I use a custom format, because I don't want to display seconds
this._StartTime.CustomFormat = System.Globalization.DateTimeFormatInfo.CurrentInfo.ShortTimePattern;
this._StartTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
...
}
我的問題是:當我選擇一個新的區域,從「區域和語言選項「在控制面板中,_StartDate顯示會更新以反映新的區域設置,但_StartTime不是。爲什麼不?
UPDATE:這似乎AF如果不更新 System.Globalization.DateTimeFormatInfo.CurrentInfo.ShortTimePattern 直到重新啓動應用程序。但是怎麼來正確顯示短日期?