Dxperience skin rejuvenation

Source: Internet
Author: User

In fact, "skin" is just a very small part of dxperience, or just a functional point. Let me briefly talk about the skin Replacement Operation of dxperience.

Prepare program. CS and frmmain. CS.

1. Drag a devexpress. xtraeditors. comboboxedit control from the toolbox to the frmmain. CS form. Shows the position of the comboboxedit control in the toolbox:

 

 

2. Add the selectedindexchanged event Method to the comboboxedit control to implement the default skin function of the form after the comboboxedit control option is changed. The Code is as follows:


1 private void comboboxedit1_selectedindexchanged (Object sender, eventargs E)
2 {
3 string skinname = comboboxedit1.editvalue. tostring ();
4 devexpress. lookandfeel. userlookandfeel. Default. skinname = skinname;
5}

3. added the frmmain. CS form load event method to implement the comboboxedit control option function after the frmmain. CS form is loaded. The Code is as follows:


1 private void frmmain_load (Object sender, eventargs E)
2 {
3 comboboxedit1.properties. texteditstyle = devexpress. xtraeditors. Controls. texteditstyles. disabletexteditor;
4 initskinlist ();
5}
6
7 /// <summary>
8 // initialize the skin style list
9 /// </Summary>
10 private void initskinlist ()
11 {
12 foreach (devexpress. Skins. skincontainer in devexpress. Skins. skinmanager. Default. skins)
13 {
14 comboboxedit1.properties. Items. Add (skincontainer. skinname );
15}
16
17 if (comboboxedit1.properties. Items. Count> 0)
18 comboboxedit1.selectedindex = 0;
19}

3. Press F5 to start debugging and you will see the actual effect. As shown in:

You can select different items from the skin style drop-down list to view the changes.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.