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")