How to: Add and Customize the Ribbon Skin List and Skin Gallery

CSkin源码接入WinForms:皮肤链路、控件重绘与避坑指南 WinForms皮肤换肤并非简单拖拽第三方控件,其底层依赖窗体绘制、控件重绘与资源加载链路。通过继承皮肤窗体基类、统一主题参数并保护设计时代码,可让自绘控件在消息循环中稳定响应悬停、焦点与缩放;将皮肤图片设为嵌入资源并规范资源名,能避免发布后皮肤丢失。技术价值在于以较低改造成本统一老系统视觉与交互,同时降低设计器打不开、GDI对象增长等接入风险。典型场景包括存量WinForms系统深色换肤、多窗体主题切换、125%和150% DPI缩放验证。围绕CSkin源码,先编译主库并用最小宿主跑通窗体、按钮、文本框和 阅读详情

皮肤列表和皮肤库允许用户选择皮肤。本文介绍如何在功能区中显示“皮肤列表”或“皮肤库”并对其进行自定义。
DevExpress演示中心中的大多数应用程序都允许您选择皮肤。例如,运行XtraGrid演示并导航到皮肤功能区页面以更改当前皮肤。
在这里插入图片描述

在功能区UI中显示皮肤列表或皮肤库

使用以下栏项将相应的UI元素添加到功能区UI:“Skin List, Skin Gallery”、“Skin Palette List”和“Skin Palette Gallery”。在RibbonPageGroup上单击鼠标右键,然后调用相应的命令在设计时添加“ Skin List ”或“Skin Gallery”。
在这里插入图片描述

Skin List

A Skin List (SkinDropDownButtonItem) is a drop-down menu that displays application skins.
在这里插入图片描述

Skin Gallery

A Skin Gallery (SkinRibbonGalleryBarItem) is an in-ribbon gallery that displays skins. Skins in the gallery are grouped into categories.
在这里插入图片描述

Skin Palette List

A Skin Palette List (SkinPaletteDropDownButtonItem) allows users to select a color palette for a vector skin.
在这里插入图片描述

Skin Palette Gallery

A Skin Palette Gallery (SkinPaletteRibbonGalleryBarItem) allows users to select a color palette in an embedded or dropdown gallery.
在这里插入图片描述

Example

在这里插入图片描述

using DevExpress.XtraBars;
using DevExpress.XtraBars.Ribbon;

namespace DXApplication20 {
    public partial class Form1 : RibbonForm {
        public Form1() {
            InitializeComponent();
            skinPageGroup.ItemLinks.Add(new SkinDropDownButtonItem());
            skinPageGroup.ItemLinks.Add(new SkinRibbonGalleryBarItem());
            colorPalettePageGroup.ItemLinks.Add(new SkinPaletteDropDownButtonItem());
            colorPalettePageGroup.ItemLinks.Add(new SkinPaletteRibbonGalleryBarItem());
        }
    }
}

Display Advanced Skin Options

显示高级skin选项

以下示例演示如何显示与高级皮肤设置相对应的预先设计的功能区UI命令:

在这里插入图片描述

using DevExpress.XtraBars;
using DevExpress.XtraBars.Helpers;

namespace DXRibbonSkinSekector {
    public partial class Form1 : DevExpress.XtraBars.Ribbon.RibbonForm {
        BarCheckItem bciTrackWindowsAppMode, bciOriginalPalette, bciTrackWindowsAccentColor;
        BarButtonItem bbiSystemAccentColor, bbiAccentCustomColor2;
        public Form1() {
            InitializeComponent();

            bciTrackWindowsAppMode = new BarCheckItem();
            bciOriginalPalette = new BarCheckItem();
            bciTrackWindowsAccentColor = new BarCheckItem();
            bbiSystemAccentColor = new BarButtonItem();
            bbiAccentCustomColor2 = new BarButtonItem();

            advancedOptionsGroup.ItemLinks.Add(bciTrackWindowsAppMode);
            advancedOptionsGroup.ItemLinks.Add(bciOriginalPalette);
            advancedOptionsGroup.ItemLinks.Add(bciTrackWindowsAccentColor);
            advancedOptionsGroup.ItemLinks.Add(bbiSystemAccentColor);
            /*
             * "The Bezier" skin supports the second accent color.
             * Other skins do not support the second accent color.
             */
            advancedOptionsGroup.ItemLinks.Add(bbiAccentCustomColor2);

            // Initializes corresponding skin settings/selectors.
            SkinHelper.InitTrackWindowsAppMode(bciTrackWindowsAppMode);
            SkinHelper.InitResetToOriginalPalette(bciOriginalPalette);
            SkinHelper.InitTrackWindowsAccentColor(bciTrackWindowsAccentColor);
            SkinHelper.InitCustomAccentColor(Ribbon.Manager, bbiSystemAccentColor);
            SkinHelper.InitCustomAccentColor2(Ribbon.Manager, bbiAccentCustomColor2);
        }
    }
}

Hide Specific Items And Groups

隐藏特定项目和组
下面的步骤描述了如何隐藏单个皮肤。

  • Create a string array that contains unwanted skin names. These names can be full (e.g., “Office 2016 Colorful”) or partial (e.g., “2007”).
string[] skinsToHide = { "Seven Classic", "DevExpress Style", "Dark", "2010", "2007", "Sharp" };

  • Define a custom method that will iterate through skin items and hide unwanted ones.
private void HideGalleryItemsByCaptions(RibbonGalleryBarItem galleryItem, string[] skinsToHide) {
    var allItems = galleryItem.Gallery.GetAllItems();
    foreach (GalleryItem item in allItems) {
        if (skinsToHide.Contains(item.Caption))
            item.Visible = false;
    }
}

  • Use the form or UserControl Load event handler to call your method.
this.Load += ucRibbon_Load;

void ucRibbon_Load(object sender, EventArgs e) {
    HideGalleryItemsByCaptions(skinRibbonGalleryBarItem1, skinsToHide);
}

To hide an entire skin group, use the code sample below.
要隐藏整个皮肤组,请使用下面的代码示例。

void ucRibbon_Load(object sender, EventArgs e) {
    skinRibbonGalleryBarItem1.Gallery.Groups.Remove(skinRibbonGalleryBarItem1.Gallery.Groups.OfType<GalleryItemGroup>()
            .First(x => String.Equals(x.Caption, "Bonus Skins")));
}

The following example demonstrates how to rename and hide gallery groups in SkinDropDownButtonItem:
以下示例演示如何在SkinDropDownButtonItem中重命名和隐藏图库组:

using System.Linq;
using DevExpress.XtraBars;
using DevExpress.XtraBars.Ribbon;
using DevExpress.XtraBars.Ribbon.Gallery;
using DevExpress.XtraBars.Helpers;

namespace DXApplication20 {
    public partial class Form1 : RibbonForm {
        SkinDropDownButtonItem skinDropDownButtonItem;
        public Form1() {
            InitializeComponent();
            skinDropDownButtonItem = new SkinDropDownButtonItem(ribbonControl1.Manager);
            skinPageGroup.ItemLinks.Add(skinDropDownButtonItem);
        }
        private void Form1_Load(object sender, System.EventArgs e) {
            HideItems(skinDropDownButtonItem);
        }
        void HideItems(SkinDropDownButtonItem skinItem) {
            GalleryControlGallery gallery = ((skinItem.DropDownControl as SkinPopupControlContainer).Controls.OfType<GalleryControl>().FirstOrDefault()).Gallery;
            gallery.Groups[0].Caption = "My Custom Caption";
            gallery.Groups[1].Visible = false;
            gallery.Groups[2].Visible = false;
        }
    }
}

The following example demonstrates how to hide the specified groups from SkinPaletteDropDownButtonItem:
以下示例演示如何从SkinPartiteDropDownButtonItem中隐藏指定的组:

void HideSkins2(SkinPaletteDropDownButtonItem skinItem, string[] palettesToHide) {
    var groups = (skinItem.DropDownControl as GalleryDropDown).Gallery.Groups;
    for(var i = 0; i < groups.Count; i++) {
        var group = groups[i];
        if(group == null) {
            continue;
        }
        for(var j = 0; j < group.Items.Count; j++) {
            var item = group.Items[j];
            if(item == null) {
                continue;
            }
            foreach(var palette in palettesToHide) {
                if(item.Caption.Contains(palette)) {
                    item.Visible = false;
                }
            }
            if(!group.HasVisibleItems())
                group.Visible = false;
        }
    }
}

Remove Item Grouping

To remove item grouping, add a new gallery group and populate it with all existing gallery items. Then, you can remove all gallery groups except for your new custom group – as illustrated in the code sample below.
若要删除项目分组,请添加一个新的库组,并用所有现有库项目填充该组。然后,您可以删除除新的自定义组之外的所有库组,如下面的代码示例所示。

void ucRibbon_Load(object sender, EventArgs e) {
    RemoveGrouping();
}

void RemoveGrouping() {
    GalleryItemGroup group = new GalleryItemGroup() { Caption = "Available Skins" };
    skinRibbonGalleryBarItem1.Gallery.Groups.Insert(0, group);
    foreach(var item in skinRibbonGalleryBarItem1.Gallery.GetAllItems()) {
        skinRibbonGalleryBarItem1.Gallery.Groups[0].Items.Add(item);
    }
    while(skinRibbonGalleryBarItem1.Gallery.Groups.Count > 1)
        skinRibbonGalleryBarItem1.Gallery.Groups.Remove(skinRibbonGalleryBarItem1.Gallery.Groups.Last());
}

Change Captions and Icons Manually

手动更改标题和图标
To change captions and glyphs of items within a Ribbon skin gallery, iterate through gallery items and modify the following properties:
要更改功能区皮肤库中项目的标题和图示符,请遍历库项目并修改以下属性:

  • GalleryItem.Caption — Gets or sets the item’s caption. 获取或设置项的标题
  • GalleryItem.Hint — Gets a hint associated with the gallery item. 获取与库项目关联的提示。
  • GalleryItem.Description — Gets or sets the item’s description.获取或设置项的描述。
  • GalleryItem.ImageOptions.SvgImage — Gets or sets a vector image. The vector image has priority over the raster image.获取或设置矢量图像。矢量图像的优先级高于光栅图像。
  • GalleryItem.ImageOptions.Image — Gets or sets a raster image. To display a custom raster image, nullify the default vector image. 获取或设置光栅图像。若要显示自定义光栅图像,请使默认矢量图像无效。
  • GalleryItem.ImageOptions.HoverImage — Gets or sets a raster image displayed when the mouse pointer hovers the item. 获取或设置鼠标指针悬停项目时显示的光栅图像。
void ucRibbon_Load(object sender, EventArgs e) {
    CustomizeItems(skinRibbonGalleryBarItem1);
}
void CustomizeItems(SkinRibbonGalleryBarItem target) {
    foreach(var item in target.Gallery.GetAllItems()) {
        if(item.Caption == "DevExpress Dark Style") {
            item.Caption = item.Hint = "Default Skin";
            item.Description = "The default skin";
            // We recommend that you use vector images.
            item.ImageOptions.SvgImage = SvgImage.FromResources("DXApplication1.Resources.Driving.svg", typeof(Form1).Assembly);
            // The vector image has priority over the raster image.
            // To assign a raster image, nullify the default vector image.
            item.ImageOptions.SvgImage = null;
            item.ImageOptions.Image = DevExpress.Images.ImageResourceCache.Default.GetImage("office2013/miscellaneous/colors_16x16.png");
            item.ImageOptions.HoverImage = DevExpress.Images.ImageResourceCache.Default.GetImage("office2013/miscellaneous/colors_32x32.png");
        }
    }
}

在这里插入图片描述

Obtain Active Skin

The following example demonstrates how to get the active skin name:

string activeSkinName = DevExpress.UserLookAndFeel.Default.ActiveSkinName;

SkinSharp: VB换肤库及37款皮肤设计实战 本文还有配套的精品资源,点击获取 简介:SkinSharp是一个专为Visual Basic (VB) 设计的换肤库,基于.NET Framework开发,它简化了为Windows Forms应用程序添加多款预设和可定制皮肤的过程。通过简单的API调用,开发者可以快速实现按钮、文本框、菜单等控件的个性化界面。该资源包还提供了37种不同风格的皮肤文件,包括现代、经典、扁平化设... 阅读详情

相关推荐

dxRibbon(VCL)控件中Contextual Tabs的显示.pdf

dxRibbon(VCL)控件中Contextual Tabs的显示.pdf

Devexpress Dxribbon风格窗体设计

转自:http://blog.163.com/bin0315@126/blog/static/406626422012844271447/ Delphi2010及其以后的版本,已经有了RIBBOB风格的窗体控件,但现在用的还不多吧。这里介绍的方法是使用第三方控件DevExpressBar来完成Ribbon风格的界面。 首先下载并安装DevExpress,版本最好是4.6以后的吧,最新的已经出了

ghs79的专栏 6273

SkinSharp通用换肤库

SkinSharp通用换肤库.rar SkinSharp通用换肤库.rar SkinSharp通用换肤库.rar

dxribbon动态生成菜单

procedure TfrmMain.btn1Click(Sender: TObject);var ribbonTab: TdxRibbonTab; ribbonTabGroup: TdxRibbonTabGroup; btn: TdxBarButton; ItemLink : TdxBarItemLink;begin //ribbon 是手拖的一个 dxribbon, 这里...

diandingkuo2879的博客 499

遥感卫星影像AI数据集格式规范详解、技术原理与数据生产全流程技术手册

本技术手册旨在系统性地梳理遥感卫星影像AI数据集的各类格式标准(涵盖VOC、COCO、YOLO及遥感专用DOTA格式等),深入剖析其背后的技术原理,并详细阐述数据生产的全过程,涵盖预处理、标注、质量控制及数据增强等关键环节。无论您是刚入门的算法工程师,还是资深的数据生产管理者,本手册都将为您提供详实的参考与指引。

panshengwu的博客 1129

别再手动算频谱了!用这个在线FFT工具,5分钟搞定JSON/CSV数据分析

本文介绍了一款高效的在线FFT工具,帮助用户快速分析JSON/CSV格式的时域数据,5分钟内完成频谱分析。通过傅里叶变换(FFT)算法,大幅提升计算效率,解决传统手动计算的痛点,适用于工业振动分析、设备故障诊断等场景。

weixin_29172201的博客 261

Dev 右键圆形菜单 dxRibbonRadialMenu控件使用

设计视图 双击dxRibbonRadialMenu1增加项目 增改显示文字 增加图标列表 代码很简单,从当前鼠标位置打开,屏蔽系统右键 procedure TForm1.cxMemo1ContextPopup(Sender: TObject; MousePos: TPoint; var Handled: Boolean); begin dxRibbonRadialMenu1.PopupFromCursorPos; Handled := True; end; 点右键最

钱多多的博客 607

RK3588网络调试笔记:当我把默认RTL8211F PHY换成另一款时,踩了哪些坑?

本文详细记录了在RK3588平台上将默认RTL8211F PHY芯片替换为其他型号的全过程,包括硬件设计验证、内核驱动适配、复位时序配置等关键步骤。通过实际案例分享,提供了从驱动调试到硬件优化的系统性解决方案,帮助开发者高效完成PHY芯片替换,确保网络接口稳定性。

weixin_30291791的博客 669

手把手教你用DevExpress WinForm添加和自定义工具栏皮肤选择器

本文主要介绍在使用DevExpress WinForm开发一个应用程序是,如何添加和自定义工具栏皮肤选择器,欢迎下载相关组件体验!

需要界面开发、IDE工具研发中文教程资料的小伙伴,记得私信我~ 3021

利用AWVS进行反制

awvs 10.5下载 http://www.32r.com/soft/12986.html

渗透之路,攻防之间皆学问 6653

【嘉立创EDA】PCB金属包边设计快捷方法

本文使用嘉立创EDA,描述如何在PCB设计时,快速增加边框包边设计,特别是金属包边(伪)——这里标记(伪)是因为该这里的包边特指不含边缘壁。请参考本文时特别注意!本文将此过程记录,以供有需要的读者参考。

l64481000的博客 1744

DevExpress 设计Ribbon界面

1、首先新建一窗体工程,从工具栏

可乐鸡翅 2万+

国网DLT698.45协议——采集系统、数据交换(一)

对于国网698协议,是一种面向对象的通信协议,用于远程监控和控制电力系统中的设备。面向对象使得对协议的思考更趋向于正常思维,使计算机中描述的抽象世界于现实世界中能够更好的对应起来。协议中就是将各种方法和属性对应描述成类和对象。接下来是我学习该协议的一些总结和认识,欢迎大家随时在评论区或者私信我交流学习。:系统=对象+消息:程序=算法+数据对象和接口类描述:类描述了一组具有相同属性和相同方法的对象。

一个bug是bug,多个bug能work 1万+

DevExpress Ribbongallerybaritem选择性皮肤重组

1 void InitSkinGallery() () { 2 3 SkinHelper skinHelper = new SkinHelper(); RibbonControl masterRibbonControl = new RibbonControl(); 4 5 ...

weixin_30318645的博客 499

ESP32 智能垃圾分类助手:从硬件搭建到代码实现的硬核指南

基于 ESP32 的智能垃圾分类设备,充分利用了 ESP32 的外设兼容性和处理能力,通过简单的模块组合和代码编写,就能实现垃圾分类的智能化。无论是作为学生的物联网课程设计,还是家庭的环保小工具,这个项目都兼具实用性和趣味性。如果你想进一步优化功能,还可以尝试加入更多传感器(如红外传感器检测垃圾满溢),让设备更加智能。

weixin_42300449的博客 930

C/C++小宇宙代码(完整代码)

C语言实现小宇宙的完整代码。

AIGC 2523

Delphi dxRibbon 风格窗体去掉标题栏

xiaobin_zb的博客 482

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

Skins

本主题解释如何将DevExpress主题/皮肤应用到应用程序中,如何允许用户在运行时在主题之间切换,如何自定义现有皮肤或创建自己的皮肤,等等。WinForms订阅包括许多基本控件:按钮、复选框、表单、消息框、对话框、对话框等。我们实现所有这些控件的一个主要原因是为了支持我们的主题。通过的开发表达,您可以获得各种各样的外观和一个全面的控制库,以保证整个应用程序的可视化一致性。要查看可用的主题/皮肤,请打开任何演示应用程序。

龙七 1314

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

我的世界java版皮肤库

我整理的一些关于【Java】的项目学习资料(附讲解~~)和大家一起分享、学习一下:https://d.51cto.com/f2PFnN如何实现“我的世界Java版皮肤库” 在这篇文章中,我将指导你如何实现一个“我的世界Java版皮肤库”。我们将分步骤进行,你将逐渐理解每一部分的实现。让我们开始吧! 整体流程 在开发“我的...

weixin_42140716的博客 2774

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

LayerSkin皮肤库:专为WinForms应用程序设计的皮肤库

LayerSkin皮肤库:专为WinForms应用程序设计的皮肤库 去发现同类优质开源项目:https://gitcode.com/ 在软件开发领域,一款优秀的用户界面(UI)设计对于提升用户体验至关重要。LayerSkin皮肤库以其独特的魅力,成为许多开发者心中的优选。以下为您详细介绍这款最新免费版的LayerSkin皮肤库,帮助您更好地了解和使用它。 项目介绍 LayerSkin皮肤库是一款专...

gitblog_06722的博客 1275

MFC皮肤库(46个)

MFC皮肤库(46个) 去发现同类优质开源项目:https://gitcode.com/ 欢迎使用本MFC皮肤库资源文件,本库包含46个精心设计的皮肤,适用于Visual Studio和VC++开发环境。这些皮肤能够为您的应用程序提供美观、统一的界面风格,增强用户体验。 文件内容 本资源文件包含以下内容: 46个MFC皮肤文件,适用于不同的界面需求。 使用说明 将下载的皮肤文件放置到您的开发...

gitblog_06702的博客 906

react项目实战(权限模块开发四) SkinDropDown插件开发

login.js文件中用到了一个SkinDropDwon插件import SkinDropCom from '../../components/SkinDropCom'; ... <SkinDropCom skinsList={loginMd.skinsList} visibility={loginMd.visibility}

飞天代码的博客 684

如何免费获取所有LOL皮肤:终极自定义皮肤资源库

英雄联盟皮肤是游戏中重要的视觉元素,但昂贵的价格让许多玩家望而却步。现在通过lol-skins项目,你可以免费体验所有官方皮肤和炫彩皮肤。这个开源资源库包含完整的自定义皮肤格式,为玩家提供了便捷的皮肤使用解决方案。 ## 项目魅力 - 完整皮肤资源一站式获取 lol-skins项目是社区维护的英雄联盟皮肤资源库,包含了游戏中所有可用的皮肤和炫彩。资源按照英雄分类整理,每个英雄都有独立的文件夹,

gitblog_00819的博客 530

VC皮肤库SkinSharp 1.0.6.6的使用

SkinSharp又称Skin#,是Windows环境下一款强大的换肤库。SkinSharp换肤库不是COM组件,无需进行系统注册,仅以标准dll方式存在。 SkinSharp作为换肤工具,只需要在您的程序中添加一行代码,就能让您的界面焕然一新,并拥有多种主题风格和色调的动态切换功能以及Vista透明边框特效。 文档网址:http://www.skinsharp.com/htdocs/do

程序道 -Learning, Thinking and Coding <存储知识的金库> 839
上一篇: How To: Localize Bar and Ribbon Skin Items
下一篇: How to: Build a Custom End-User Skin Selector
missingzlp
博客等级 码龄16年 365粉丝 170原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值