/// <summary> /// 执行皮肤的初始化 /// </summary> public static void BeforeStart() { object obj = System.Configuration.ConfigurationManager.AppSettings["ApplySkin"]; bool useSkin = obj != null && obj.ToString().ToLower() == "true"; if (useSkin) { DevExpress.UserSkins.BonusSkins.Register(); DevExpress.UserSkins.OfficeSkins.Register(); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (useSkin) { if (!DevExpress.Skins.SkinManager.AllowFormSkins) { DevExpress.Skins.SkinManager.EnableFormSkins(); } SystemAllConfig config = StaticCacheManager.GetConfig <SystemAllConfig>(); DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName = config.SkinName; } }
void tmp1_Click(object sender, EventArgs e) { ToolStripMenuItem skin = sender as ToolStripMenuItem; string text = skin.Text; if(text.Length>0) { DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName = text; SystemAllConfig config = new SystemAllConfig(); config.SkinName = text; StaticCacheManager.SaveConfig<SystemAllConfig>(config); } //throw new Exception("The method or operation is not implemented."); }