2013-02-26 39 views
0

我想更改DateTimePicker控件的語言。爲此,我在DropDown事件DateTimePicker控件上更改了區域語言,但它不影響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; 
} 

我也是在這之後

​​

嘗試,但仍然有問題:-(

+0

的http://計算器.com/questions/3148234/how-do-i-set-the-language-for-datetimepicker – Derek 2013-02-26 09:12:22

回答

0

Сhange您ThreadCulture

System.Globalization.CultureInfo cultureInfo = new System.Globalization.CultureInfo("xx-XX"); 
System.Threading.Thread.CurrentThread.CurrentCulture = cultureInfo; 
System.Threading.Thread.CurrentThread.CurrentUICulture = cultureInfo; 
+1

默認情況下,th只有在程序開始時執行,才能緩存所有資源。 – 2013-02-26 09:32:29

+0

@Matthew Watson - +1感謝信息) – MikroDel 2013-02-26 10:04:12

+0

感謝MikroDel,但日曆仍然是英文:-( – 2013-02-26 10:50:46