banner



Skin Magical Set 1 How To Use

DevExpress WinForms controls include many ready-to-use paint themes (or skins) for changing DevExpress forms' and controls' advent. You lot tin come across the different skins by running WinForms Demo Applications and switching between the bachelor themes using a Peel Selector.

Skins Demo Selector

This topic describes the bachelor raster and vector skins, how to apply a pare to the entire application and private controls, how to alter a pare'southward color palette and how to create a custom skin.

  • Vector Themes
  • Bones Raster Skin Set
  • Additional Raster Themes
  • High Contrast Skins
  • Apply Themes to Entire Application
  • Persist Selected Theme Betwixt Application Sessions
  • Form Title Bar and Edge Skinning
  • Runtime Skin Selector UI
  • Colour Mixer: Conform Raster Peel Colors
  • How to Distinguish Calorie-free from Dark Skins in Code
  • Pare Editor: Modify and Re-Package Skins
  • Form Borders

Vector Themes

Vector skins apply vector images for all UI elements to amend the brandish quality on high-resolution devices. Vector skins are stored in the DevExpress.Utils library.

Each vector pare can accept multiple palettes (swatches) that are skin color themes. RibbonControl includes the "Skin Palette Gallery" item that allows users to switch palettes at runtime.

Skins - Ribbon Palette Gallery

The following lawmaking illustrates how to alter the default palette and\or create additional ones:

  • C#
  • VB.Internet
              //obtain a vector skin var commonSkin = CommonSkins.GetSkin(LookAndFeel); //create a new palette SvgPalette svgPalette = new SvgPalette(); //prepare palette colors svgPalette.Colors.Add(new SvgColor("Paint", Colour.FromArgb(242, 242, 242))); svgPalette.Colors.Add together(new SvgColor("Paint High", Color.FromArgb(255, 255, 255))); svgPalette.Colors.Add together(new SvgColor("Paint Shadow", Colour.FromArgb(222, 222, 222))); svgPalette.Colors.Add(new SvgColor("Brush", Color.FromArgb(fourscore, 80, 80))); svgPalette.Colors.Add(new SvgColor("Brush Light", Color.FromArgb(150, 150, 150))); svgPalette.Colors.Add(new SvgColor("Brush High", Colour.FromArgb(80, 80, fourscore))); svgPalette.Colors.Add(new SvgColor("Brush Major", Color.FromArgb(180, 180, 180))); svgPalette.Colors.Add(new SvgColor("Brush Small-scale", Color.FromArgb(210, 210, 210))); svgPalette.Colors.Add(new SvgColor("Accent Paint", Color.FromArgb(23, 107, 209))); svgPalette.Colors.Add(new SvgColor("Emphasis Paint Lite", Colour.FromArgb(191, 224, 255))); svgPalette.Colors.Add(new SvgColor("Accent Brush", Color.FromArgb(255, 255, 255))); svgPalette.Colors.Add(new SvgColor("Accent Brush Calorie-free", Color.FromArgb(81, 148, 224))); svgPalette.Colors.Add together(new SvgColor("Central Paint", Color.FromArgb(71, 71, 71))); svgPalette.Colors.Add together(new SvgColor("Key Castor", Color.FromArgb(255, 255, 255))); svgPalette.Colors.Add together(new SvgColor("Key Brush Calorie-free", Color.FromArgb(150, 150, 150))); svgPalette.Colors.Add(new SvgColor("Red", Color.FromArgb(226, 54, 66))); svgPalette.Colors.Add(new SvgColor("Greenish", Color.FromArgb(60, 146, 92))); svgPalette.Colors.Add together(new SvgColor("Blue", Color.FromArgb(58, 116, 194))); svgPalette.Colors.Add together(new SvgColor("Yellowish", Color.FromArgb(252, 169, 10))); svgPalette.Colors.Add together(new SvgColor("Blackness", Color.FromArgb(122, 122, 122))); svgPalette.Colors.Add together(new SvgColor("Gray", Color.FromArgb(190, 190, 190))); svgPalette.Colors.Add(new SvgColor("White", Color.FromArgb(255, 255, 255))); //replace the default color palette with a custom one commonSkin.SvgPalettes[Skin.DefaultSkinPaletteName].CustomPalette = svgPalette; LookAndFeelHelper.ForceDefaultLookAndFeelChanged(); //or //add a new swatch commonSkin.CustomSvgPalettes.Add(new SvgPaletteKey(commonSkin.CustomSvgPalettes.Count, "PALETTE_NAME"), svgPalette);                          

You can repaint vector skins and change their palettes in the updated WinForms Skin Editor. Encounter the Working with Vector Skins article to learn more.

Basic Raster Pare Fix

The following gallery demonstrates the default skins that are part of the DevExpress.Utils library (all projects that employ DevExpress WinForms controls require this library):

Additional Raster Themes

Add the DevExpress.BonusSkins assembly to your projection to utilise additional skins that are not included in the bones set described above.

Bonus skins are divided into the post-obit two categories:

Bonus Skins

Theme Skins

To access bonus skins at blueprint time, select Register BonusSkins from the DefaultLookAndFeel component'due south smart tag. If this command is not available, then the bonus themes have already been registered. Certain DevExpress Project Templates automatically annals bonus skins.

DefaultLookAndFeel Register Bonus Skins

To register bonus skins in code, kickoff ensure that your project references the DevExpress.BonusSkins assembly. Then telephone call the DevExpress.UserSkins.BonusSkins.Annals method before the main application form runs.

  • C#
  • VB.Internet
              namespace WindowsFormsApplication1 {     static form Programme {         [STAThread]         static void Principal() {             DevExpress.UserSkins.BonusSkins.Register();              Application.EnableVisualStyles();             Application.SetCompatibleTextRenderingDefault(false);             Application.Run(new Form1());         }     } }                          

You can use bonus skins one time they are registered. The following code sets the Pumpkin bonus skin as the application'southward default skin:

  • C#
  • VB.NET
              private void Form1_Load(object sender, EventArgs e) {     DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("Pumpkin"); }                          

High Contrast Skins

Prior to v21.1, the DevExpress skin pack had a single theme for users with a depression vision damage - the raster "High Dissimilarity" skin available every bit a office of the bonus skins category.

In v21.one this raster skin was renamed to "Loftier Contrast (archetype)". The "High Contrast" name now belongs to a new vector pare that ships with multiple color palettes.

Vector High Contrast skin

The appearance and availability of this theme depends on user settings (the "Personalize | Loftier dissimilarity settings" menu in Windows).

  • If Windows high contrast fashion is off, users can select the "Loftier Contrast" peel like any other DevExpress theme. Pare palette selectors are as well available.
  • If Windows high contrast is on, all UI selectors that allow users to change skins and palettes are disabled, and the vector "Loftier Contrast" peel with the "Default" palette becomes active. The "Default" palette uses same colors a user sets in the Windows "Loftier contrast settings" screen.

You can disable the static WindowsFormsSettings.TrackSystemHighContrastMode property to preclude your application from tracking the actual state of Windows high contrast mode. In this case applications do not switch the "Loftier Contrast" skin on or off, and users can select whatsoever skin they want.

Apply Themes to Entire Application

Invoke the DevExpress Project Settings page and select a desired theme to apply it to the entire application.

Project Settings Page

Alternatively, call the UserLookAndFeel.Default static object'south UserLookAndFeel.SetSkinStyle method.

  • C#
  • VB.Cyberspace
              using DevExpress.LookAndFeel; // ... UserLookAndFeel.Default.SetSkinStyle("VS2010");                          

To utilize a vector skin in code, utilize the UserLookAndFeel.SetSkinStyle method overload that takes a SkinSvgPalette object as a parameter. This parameter allows y'all to apply a pre-defined color palette (swatch) to a pare.

  • C#
  • VB.NET
              UserLookAndFeel.Default.SetSkinStyle(SkinSvgPalette.Bezier.LeafRustle);                          

Persist Selected Theme Between Application Sessions

Windows Forms Awarding Settings feature allows y'all to create, store, and maintain custom awarding and user preferences on client computers. You can use this feature to save and restore active skins and palettes when your application restarts.

Double-click the "Settings.settings" file in the Visual Studio Solution Explorer and create two entries of the String type. Gear up the scope of both entries to "User". When an awarding is about to close, save values of the UserLookAndFeel.Default.SkinName and UserLookAndFeel.Default.ActiveSvgPaletteName properties to Application Settings. When an application starts, read these saved values and laissez passer them to the UserLookAndFeel.SetSkinStyle method as parameters.

          <?xml version='1.0' encoding='utf-8'?> <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="DXApplication1.Properties" GeneratedClassName="Settings">   <Profiles/>   <Settings>     <Setting Name="SkinName" Blazon="Organization.String" Telescopic="User">       <Value Profile="(Default)" />     </Setting>     <Setting Proper name="Palette" Type="Arrangement.Cord" Scope="User">       <Value Profile="(Default)" />     </Setting>   </Settings> </SettingsFile>                  
  • C#
  • VB.Internet
              individual void Form1_FormClosing(object sender, FormClosingEventArgs e) {     var settings = Properties.Settings.Default;     settings.SkinName = UserLookAndFeel.Default.SkinName;     settings.Palette = UserLookAndFeel.Default.ActiveSvgPaletteName;     settings.Relieve(); }  protected override void OnShown(EventArgs east) {     base.OnShown(e);     var settings = Properties.Settings.Default;     if(!String.IsNullOrEmpty(settings.SkinName)) {         if(!String.IsNullOrEmpty(settings.SkinName)) {             UserLookAndFeel.Default.SetSkinStyle(settings.SkinName, settings.Palette);         }         else             UserLookAndFeel.Default.SetSkinStyle(settings.SkinName);     } }                          

View Case: How to salve/restore the applied skin and palette between application sessions

Class Title Bar and Edge Skinning

Skins and palettes alter the appearance of DevExpress forms and message boxes.

form-title-bar-skinning.png

To disable title bar and border skinning, use a compatibility option (see Version Compatibility: Default Property Values) or call the WindowsFormsSettings.DisableFormSkins method.

Related API

  • WindowsFormsSettings.EnableFormSkins

  • WindowsFormsSettings.DisableFormSkins

Runtime Pare Selector UI

DevExpress Toolbars and Menus and Ribbon include pre-divers skin selector items - SkinBarSubItem and SkinRibbonGalleryBarItem - which are automatically populated with available skin items and allow end-users to switch an awarding theme at any time.

Skins Ribbon Gallery

You lot can also add the SkinDropDownButtonItem and SkinPaletteRibbonGalleryBarItem skin selectors.

The SkinDropDownButtonItem displays bachelor skins in a drop-downward listing. Different SkinBarSubItem, the SkinDropDownButtonItem allows you lot to search for a specific skin by its name and hide unwanted pare groups.

Skins - Skin List Item

The SkinPaletteRibbonGalleryBarItem selector displays swatches instead of skins. It is hidden if a traditional raster skin is currently agile. Note that this detail is only available in the Ribbon Control and does non support the Bar Director.

Skins - Stripe Selector

You can create all these pare selectors at pattern time using the Ribbon and Toolbar smart tags.

Skins - Add Skin and Stripe Selectors

To change skin selectors' detail captions and icons, handle the static DevExpress.XtraBars.Helpers.SkinHelper.CreateGalleryItem event.

  • C#
  • VB.NET
              SkinHelper.CreateGalleryItem += (s, e) => {        if(e.SkinName.Equals(MySkinName)) {           e.GalleryItem.Paradigm = east.UseLargeIcons ? MyLargeIcon : MySmallIcon;           e.GalleryItem.HoverImage = MyLargeIcon;           eastward.GalleryItem.Caption = "Glacier";     }   };                          

You lot tin also manually obtain the listing of available skin styles and create a custom UI element to switch between them. Refer to the following topics to acquire how to use a built-in selector and create a custom i:

  • Add together and Customize the Toolbar and Menu Skin Selector
  • Add and Customize the Ribbon Gallery Pare Selector
  • Build a Custom Terminate-User Peel Selector
  • How To: Localize Bar and Ribbon Peel Items

Adjust Skin Colors

DevExpress skins allow you to modify their default color palettes. For example, you can adjust the Office 2022 Colorful skin's default colors (which are based on MS Outlook colors) to friction match other MS Office applications' color palette.

Skins Color Wheel Office Colors

Yous tin use the pre-defined Color Mixer dialog to adapt the peel color in DevExpress WinForms demos, as shown below.

Color Wheel Demos

Use the post-obit code to invoke this dialog in your application:

  • C#
  • VB.NET
              using DevExpress.XtraEditors.ColorWheel; //.. ColorWheelForm cwForm = new ColorWheelForm(); cwForm.Prove();                          

You can also use an application'southward DefaultLookAndFeel component or a specific control's LookAndFeel property to customize the skin color palette at design fourth dimension or in code.

Fellow member Description
UserLookAndFeel.SkinMaskColor Specifies the chief or background colour.
UserLookAndFeel.SkinMaskColor2 Specifies the highlight color.
UserLookAndFeel.SetSkinMaskColors Allows you to set both colors in i call.

You tin can access these properties at design time.

Color Wheel Properties

Telephone call the method below to arrange the peel palette in lawmaking.

  • C#
  • VB.NET
              UserLookAndFeel.Default.SetSkinMaskColors(Colour.FromArgb(255, 60, 245, sixty), Color.White);                          

How to Distinguish Light from Dark Skins in Code

All DevExpress skins and palettes autumn into two categories: dark and light. To identify an active theme category, call the DevExpress.Utils.Frames.FrameHelper.IsDarkSkin method.

  • C#
  • VB.NET
              using DevExpress.Utils.Frames; //... if (FrameHelper.IsDarkSkin(this.GetActiveLookAndFeel())) {     //electric current peel/palette is dark } else {     //current peel/palette is light }                          

Skin Editor: Change and Re-Package Skins

A skin is a set up of bitmaps, fonts, and alignment settings that determine how command elements are painted in all possible states: normal, hot-tracked, selected, etc. DevExpress designers utilize the Pare Editor application to associate skin attributes with individual controls, and this information is compiled into the skin assemblies mentioned earlier. You can access the Peel Editor awarding from the DevExpress carte du jour in Visual Studio to modify skins to fit a specific corporate way or re-packet skins into lightweight DLLs.

  • Create New Skins
  • Export and Apply Custom Skins

Landing Page Image

Class Borders

In mod apartment skins like "Part 2022 Colorful", DevExpress forms have thin borders. This may be inconvenient for users, since when they try to resize a grade they have to aim for those thin borders with a mouse pointer. To improve the user experience, the resize surface area of DevExpress forms includes both borders and a form shadow/glow pare element. This allows a user to resize a form when a mouse pointer hovers over the form shadow.

In certain cases, forms cannot display shadows.

  • When you manually disable the XtraForm.FormBorderEffect holding.
  • When forms are kid MDI forms.
  • When a user accesses the application through a Remote Desktop connection.

image

In these cases, you can increase form border size to broaden the resize area.

image

To do that, enable either the WindowsFormsSettings.FormThickBorder or WindowsFormsSettings.MdiFormThickBorder property depending on whether you want to increase border size for all DevExpress forms, or only those that serve as child MDI forms.

Utilise the WindowsFormsSettings.ThickBorderWidth holding to modify the thick border width.

Tip

Forms switch to thick borders when you enable the Remote Connectedness Optimization mode. Disable the FormThickBorder belongings to keep skin-based borders when this mode is on.

Meet As well

Skin Magical Set 1 How To Use,

Source: https://docs.devexpress.com/WindowsForms/2399/build-an-application/skins

Posted by: atchisoncomence.blogspot.com

0 Response to "Skin Magical Set 1 How To Use"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel