DevExpress Tricks - Theme
1.窗体主题
窗体的标题栏和边框若要受到DevExpress的Theme的影响, 需要在在窗体OnLoad时运行以下两行:
private void TestForm_Load(object sender, EventArgs e)
{
DevExpress.Skins.SkinManager.EnableFormSkins();
DevExpress.UserSkins.BonusSkins.Register();
}
2.MDI Child Form主题
通过继承DevExpress.XtraEditors.XtraForm创建的MDI Child Forms默认并不会随着Theme的切换而切换,事实上,必须通过重载窗体的GetAllowSkin方法来实现
protected override bool GetAllowSkin() { if (this.DesignMode) return false; return true; }