[DevExpress]Devexpress中統一設置字體樣式的方法

#region 設置默認字體、日期格式、漢化dev
DevExpress.Utils.AppearanceObject.DefaultFont = new System.Drawing.Font("Tahoma", 12);

DevExpress.XtraEditors.WindowsFormsSettings.DefaultFont= new System.Drawing.Font("Tahoma", 12);
DevExpress.XtraEditors.WindowsFormsSettings.DefaultMenuFont = new System.Drawing.Font("Tahoma", 12);
DevExpress.XtraEditors.WindowsFormsSettings.DefaultPrintFont= new System.Drawing.Font("Tahoma", 12);

System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-CHS");//使用DEV漢化資源文件
//設置程序區域語言設置中日期格式
System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo("zh-CHS");
System.Globalization.DateTimeFormatInfo di = (System.Globalization.DateTimeFormatInfo)System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.Clone();
di.DateSeparator = "-";
di.ShortDatePattern = "yyyy-MM-dd";
di.LongDatePattern = "yyyy'年'M'月'd'日'";
di.ShortTimePattern = "H:mm:ss";
di.LongTimePattern = "H'時'mm'分'ss'秒'";
ci.DateTimeFormat = di;
System.Threading.Thread.CurrentThread.CurrentCulture = ci;
#endregion
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章