皮肤列表和皮肤库允许用户选择皮肤。本文介绍如何在功能区中显示“皮肤列表”或“皮肤库”并对其进行自定义。
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()