DevExpress: Themes/Skins in C#
By FoxLearn 6/18/2017 10:45:30 AM 10.85K
How to use DevExpress Skin Manager in C#.
Step 1: Click New Project, then select Visual C# on the left, then Windows and then select Windows Forms Application. Name your project "SkinDemo" and then click OK
If you have not yet installed DevExpress .NET products, you can view How to download and install DevExpress
Step 2: Design your form as below
Step 3: Add code to handle your form as below
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; using DevExpress.XtraEditors; using DevExpress.XtraBars.Helpers; using DevExpress.Skins; namespace SkinDemo { public partial class XtraForm1 : DevExpress.XtraEditors.XtraForm { public XtraForm1() { InitializeComponent(); } private void XtraForm1_Load(object sender, EventArgs e) { SkinHelper.InitSkinPopupMenu(SkinsLink); //Add skin to combobox foreach(SkinContainer cn in SkinManager.Default.Skins) { cboSkins.Properties.Items.Add(cn.SkinName); } } private void cboSkins_SelectedIndexChanged(object sender, EventArgs e) { //Set default look and feel DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle(cboSkins.Text); } } }
Open Program class, then change your code as below
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; namespace SkinDemo { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { //Register skins DevExpress.UserSkins.BonusSkins.Register(); DevExpress.Skins.SkinManager.EnableFormSkins(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new XtraForm1()); } } }
VIDEO TUTORIALS
Categories
Popular Posts
Visual Studio: Auto increment version
04/01/2024
What is ARM architecture?
04/01/2024
What Are RESTful Web Services?
02/19/2024