How to: Build a Custom End-User Skin Selector

This section explains how to populate a ComboBoxEdit control with DevExpress skin items.
本节介绍如何使用DevExpress皮肤项填充ComboBoxEdit控件。

  • To populate a combo box editor, iterate through the SkinManager.Skins collection, which returns all currently available DevExpress skins, and create a new combo box item for each applicable skin – as illustrated in the code below.
    要填充组合框编辑器,请遍历SkinManager.Skins集合,返回所有当前可用的DevExpress皮肤,并为每个适用的皮肤创建一个新的组合框项目,如下面的代码所示。
//Uncomment the following line to add bonus and theme skins
//DevExpress.UserSkins.BonusSkins.Register();
foreach (SkinContainer cnt in SkinManager.Default.Skins) {
   
   
    comboBoxEdit1.Properties.Items.Add(cnt.SkinName);
}

  • You can implement more complex logic to skip or rename specific skins. For instance, the following code sample excludes the “Caramel” skin and any “Office 2007…” skin, and renames “DevExpress Style” and “DevExpress Dark Style” skins to ”Default Skin” and ”Default Dark Skin”, respectively.
    您可以实现更复杂的逻辑来跳过或重命名特定的皮肤。例如,以下代码示例排除了“焦糖”皮肤和任何“Office 2007…”皮肤,并将“DevExpress Style”和“DevExpress Dark Style”皮肤分别重命名为“Default skin”和“Default Dark skin”。
DevExpress.UserSkins.BonusSkins.Register();
foreach (SkinContainer cnt in SkinManager.Default.Skins) {
   
   
    if (cnt.SkinName.Contains("Office 2007") || cnt.SkinName == "Caramel")
        
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值