1. Add a reference to DevExpress. OfficeSkins to the reference of the project.
2. Add the following two lines of code to Program. cs:
DevExpress.UserSkins.OfficeSkins.Register();DevExpress.Skins.SkinManager.EnableFormSkins();
3. Drag an imageComboBoxEdit control on the form. The control name is imageComboBoxEdit1.
4. Add the following code to the load event of the form
// Add the userimagecomboboxedit1.selectedindexchanged + = new EventHandler (switchSkin) to imageComboBoxEdit; // obtain all available skin names and add them to comboxforeach (DevExpress. skins. skinContainer cnt in DevExpress. skins. skinManager. default. skins) {imageComboBoxEdit1.Properties. items. add (new ImageComboBoxItem (cnt. skinName, cnt. skinName); // This statement is used to add the combox on the ribbon control. // repositoryItemImageComboBox2.Properties. items. add (new ImageComboBoxItem (cnt. skinName, cnt. skinName ));}
5. The switchSkin method is as follows:
public void switchSkin(object sender, EventArgs e){ ImageComboBoxEdit editor = sender as ImageComboBoxEdit; DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle(editor.EditValue.ToString());}
In this way, you can use imageComboBoxEdit to switch the skin.