0

我想改变DateTimePicker控制语言。为此,我在控件的 DropDown 事件上更改了区域语言DateTimePicker,但它不影响 DateTimePicker 控件。代码是

private void dtpDate_DropDown(object sender, EventArgs e)
{
    System.Globalization.CultureInfo ci = new   System.Globalization.CultureInfo("fr-FR");
    System.Threading.Thread.CurrentThread.CurrentCulture = ci;
}

在此之后我也尝试过

dtpDate.Format = DateTimePickerFormat.Custom;
string[] formats = dtpDate.Value.GetDateTimeFormats(Application.CurrentCulture);
dtpDate.CustomFormat = formats[0]; 

但仍然有问题:-(

4

1 回答 1

0

СhangeCulture你的Thread

 System.Globalization.CultureInfo cultureInfo = new System.Globalization.CultureInfo("xx-XX");
 System.Threading.Thread.CurrentThread.CurrentCulture = cultureInfo;
 System.Threading.Thread.CurrentThread.CurrentUICulture = cultureInfo;
于 2013-02-26T09:09:50.750 回答