using Gs.DevApp.Properties; using System; namespace Gs.DevApp.UserControl { public partial class SelectFont : DevExpress.XtraEditors.XtraForm { public SelectFont() { InitializeComponent(); } private void simpleButton1_Click(object sender, EventArgs e) { if (comboBoxEdit1.SelectedIndex <= 0) { Gs.DevApp.ToolBox.MsgHelper.ShowInformation("请选择字体大小!"); return; } string strFont = comboBoxEdit1.Text.Trim(); Settings.Default.fontSizeName = strFont; Settings.Default.Save(); string[] ary = strFont.Split(','); float _ft = float.Parse(ary[1]); #region 设置默认字体、日期格式、汉化dev DevExpress.Utils.AppearanceObject.DefaultFont = new System.Drawing.Font(ary[0], _ft); DevExpress.XtraEditors.WindowsFormsSettings.DefaultFont = new System.Drawing.Font(ary[0], _ft); DevExpress.XtraEditors.WindowsFormsSettings.DefaultMenuFont = new System.Drawing.Font(ary[0], _ft); DevExpress.XtraEditors.WindowsFormsSettings.DefaultPrintFont = new System.Drawing.Font(ary[0], _ft); #endregion Gs.DevApp.ToolBox.MsgHelper.ShowInformation("设置成功!"); this.Close(); } } }