【问题标题】:Devexpress SkinRibbonGalleryBar how to change the whole form (Including frame)Devexpress SkinRibbonGalleryBar如何改变整个表单(包括框架)
【发布时间】:2015-02-10 07:02:11
【问题描述】:

我有一个 WinForm,它使用 SkinRibbonGalleryBar 在运行时自定义设计。 现在,如果我在那里选择一个皮肤,它将应用于应用程序,但所有框架都具有基本的 windows 7 外观,而不是自定义设计。 如何设置框架也会改变它们的外观?

注意:由于这一切都在设计器中进行管理,因此我没有此代码!

编辑:主窗体的框架正在改变,但不是由主窗体打开的其他窗体的框架。

编辑 2:所有表单都是 Devexpress 的 Xtra 控件,它曾经工作一次。

编辑 3:新表单的第一行: 公共部分类信息:DevExpress.XtraEditors.XtraForm

【问题讨论】:

  • 您的表单是Form class descendant 还是XtraForm class descendant?
  • @nempoBu4 更改了我的帖子,所有表单都是 XtraForms
  • 能否在表单代码的第一行添加,例如:public partial class Form1 : Formpublic partial class Form2 : XtraForm
  • @nempoBu4 在问题中添加了一行

标签: c# winforms forms devexpress


【解决方案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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-09-13
    • 1970-01-01
    • 1970-01-01
    • 2014-02-20
    • 1970-01-01
    • 2015-05-16
    • 1970-01-01
    • 2015-10-11
    相关资源
    最近更新 更多