Author: Ditch Oil
Preface:
Because the color of the system is too monotonous, we decided to enable DevExpress skin-changing function to make the interface more beautiful! ___________
The author's Dev Express has been changed to 17.2.3, but if you don't want to upgrade, you can continue to use the old version of Dev Express, because the old and the new are not so different!
1. First, we go into Program and add the following code in Main():
1 //Enable skin 2 DevExpress.Skins.SkinManager.EnableFormSkins(); 3 DevExpress.LookAndFeel.LookAndFeelHelper.ForceDefaultLookAndFeelChanged(); 4 DevExpress.Skins.SkinManager.EnableMdiFormSkins();
2. Open the frmMain form and add an Xtra Tabbed Mdi Manager, Bar Manager, Dock Manager, DefaultLook AndFeel, named as:
3. A new BarEditItem named beItemColor is added at the bottom of Bar.
4. Create a new Skins table in the database to save the skin selected by the user. (Of course, you can write to Xml, and you can skip this section if you choose to write to Xml)
Skins1 USE [IVW] 2 GO 3 4 /****** Object: Table [dbo].[Skins] Script Date: 2017/11/25 19:53:47 ******/ 5 SET ANSI_NULLS ON 6 GO 7 8 SET QUOTED_IDENTIFIER ON 9 GO 10 11 CREATE TABLE [dbo].[Skins]( 12 [Id] [int] IDENTITY(1,1) NOT NULL, 13 [UserId] [int] NOT NULL, 14 [UserCode] [nvarchar](10) NOT NULL, 15 [Values] [nvarchar](50) NOT NULL, 16 [Name] [nvarchar](50) NOT NULL, 17 [DateTime] [datetime] NOT NULL, 18 CONSTRAINT [PK_Skins] PRIMARY KEY CLUSTERED 19 ( 20 [Id] ASC 21 )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] 22 ) ON [PRIMARY] 23 GO 24 25 EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Skins', @level2type=N'COLUMN',@level2name=N'Id' 26 GO 27 28 EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'user Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Skins', @level2type=N'COLUMN',@level2name=N'UserId' 29 GO 30 31 EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'user designation codes' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Skins', @level2type=N'COLUMN',@level2name=N'UserCode' 32 GO 33 34 EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Skin code' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Skins', @level2type=N'COLUMN',@level2name=N'Values' 35 GO 36 37 EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Skin name' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Skins', @level2type=N'COLUMN',@level2name=N'Name' 38 GO