This article from: http://blog.csdn.net/educast/article/details/4730631
Devexpress is used today. I think about skin change. I have referred to the devexpress skin change hands tutorial of Boyou,
This article has already enabled form skin replacement, but how to set the skin for opening the form in the future is not mentioned, but it can be implemented with a slight extension.
I like simplification of complex problems. It is much easier to do so based on tannaiyin.
Step 1All forms are inherited from devexpress. xtraeditors. xtraform.
Step 2: Add two references:
Devexpress. bonusskins. v9.2
Devexpress. officeskins. v9.2
Step 3: Add:
Devexpress. userskins. bonusskins. Register ();
Devexpress. userskins. officeskins. Register ();
Devexpress. Skins. skinmanager. enableformskins ();
Application. enablevisualstyles ();
Application. setcompatibletextrenderingdefault (false );
Application. Run (New formmain ());
Step 4
Create a form base class, and add
1 public class frmbase: devexpress. xtraeditors. xtraform
2 {
3 protected static devexpress. lookandfeel. defaultlookandfeel defalooklookandfeel = new devexpress. lookandfeel. defalooklookandfeel ();
4}
Step 5: The new form inherits from the frmbase
Step 6: enumerate all the skins in one form and put them in a comboboxedit file. The Code is as follows:
Foreach (DevExpress. Skins. SkinContainer skin DevExpress. Skins. SkinManager. Default. Skins)
CmbAppStyle. Properties. Items. Add (skin. SkinName );
The seventh step is to set the skin. You only need to set the DefaultLookAndFeel of the base class. The Code is as follows: frmBase. defalooklookandfeel. LookAndFeel. SkinName = cmbAppStyle. EditValue. ToString ();