2015-02-10 112 views
0

我有一個WinForm,它使用SkinRibbonGalleryBar在運行時自定義設計。 現在,如果我在那裏選擇皮膚,它將應用於應用程序,但所有框架都具有基本的Windows 7外觀,而不是定製設計。 我怎樣才能設置框架也將改變他們的外觀呢?Devexpress SkinRibbonGalleryBar如何更改整個窗體(包括框架)

注意:由於這是所有設計師管理的,我有沒有這個代碼!

編輯:主窗體的框架正在改變,但不是由主窗體打開的其他窗體的框架。

編輯2:所有窗體都是Devexpress的Xtra控件,它曾經工作過一次。

編輯3: 公共部分類信息:一種新形式的第一行DevExpress.XtraEditors.XtraForm

+0

是你的表格是'Form'類後裔或'XtraForm'類後裔? – nempoBu4 2015-02-10 10:27:56

+0

@ nempoBu4更改我的帖子,所有表單都是XtraForms – Marcel 2015-02-10 10:35:55

+0

您可以添加表單代碼的第一行,例如:'public partial class Form1:Form'或'public partial class Form2:XtraForm'? – nempoBu4 2015-02-10 11:44:35

回答

1

爲了使主窗體的框架換膚功能,應用剝皮繪畫方案的形式(例如通過DefaultLookAndFeel組件),並調用WindowsFormsSettings.EnableFormSkins。 要爲MDI子DevExpress表單啓用子窗體的框架蒙皮功能,應用蒙皮繪製方案(例如,通過DefaultLookAndFeel組件),並在運行時調用WindowsFormsSettings.EnableFormSkins,然後調用WindowsFormsSettings.EnableMdiFormSkins方法。

通常情況下,這個方法應該叫上應用程序的啓動:

//[Program.cs] 
using System; 
using System.Windows.Forms; 
using DevExpress.XtraEditors; 

namespace WindowsFormsApplication8 { 
    static class Program { 
     /// <summary> 
     /// The main entry point for the application. 
     /// </summary> 
     [STAThread] 
     static void Main() { 
      Application.EnableVisualStyles(); 
      Application.SetCompatibleTextRenderingDefault(false); 

      //Enable title bar skinning 
      WindowsFormsSettings.EnableFormSkins(); 
      WindowsFormsSettings.EnableMdiFormSkins(); 

      Application.Run(new Form1()); 
     } 
    } 
} 

相關求助文章:Form Title Bar Skinning