Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Expand]Controls and Libraries
 [Collapse]Common Features
  [Expand]Data Binding Common Concepts
  [Expand]Data Source Wizard
  [Expand]Expressions
  [Expand]Behaviors
  [Collapse]Application Appearance
    Default Application Font
    Appearances
   [Collapse]Look And Feel
     Look and Feel Mechanism
     How to: Customize the Look And Feel of a Specific Control(s)
     How to: Customize the Look And Feel of All the Controls within a Form
     How to: Customize the Look And Feel of All the Controls within an Application
    Glyph Skinning
  [Expand]Filtering UI Context
  [Expand]High DPI Support
  [Expand]Scaffolding Wizard
  [Expand]Formatting Values
   HTML Text Formatting
  [Expand]Menus
  [Expand]Tooltip Management
  [Expand]Saving and Restoring Layouts
   Clipboard - Copy and Paste Operations. Data Formatting
   Version Compatibility: Default Property Values
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Look and Feel Mechanism

The Look And Feel mechanism is encapsulated by the UserLookAndFeel class, and each DevExpress control that supports this mechanism provides a LookAndFeel property of that class. Moreover, there is a static Default LookAndFeel object that by default, provides look and feel settings for all controls within an application. The Default LookAndFeel's settings can be adjusted via the UserLookAndFeel.Default static property or the DefaultLookAndFeel component.

The following image illustrates the LookAndFeel settings for a button editor.

There are two settings (UseDefaultLookAndFeel and UseWindowsXPTheme) in the LookAndFeel object that can disable all other settings.


The UseDefaultLookAndFeel setting

If a control's UserLookAndFeel.UseDefaultLookAndFeel property is set to true, all the other settings of the control's LookAndFeel object are ignored. In this case, the control's current painting scheme is determined either by a Parent LookAndFeel object or by the Default LookAndFeel object, depending upon whether the UserLookAndFeel.ParentLookAndFeel property refers to a valid object.

The UserLookAndFeel.ParentLookAndFeel property lets you specify the Parent LookAndFeel object for the control's LookAndFeel object. For example, you can create a UserLookAndFeel object and assign it to the UserLookAndFeel.ParentLookAndFeel properties of a group of controls. If all of these controls have their UseDefaultLookAndFeel properties set to true, they will be painted using the painting scheme determined by the Parent LookAndFeel.

Usually, you only need to assign the Parent LookAndFeel object to controls in rare cases, as there are more elegant ways of providing centralized control over the LookAndFeel settings of a group of controls (see the sections below).

If the Parent LookAndFeel is not assigned to a control (the UserLookAndFeel.ParentLookAndFeel property is set to null) and the UseDefaultLookAndFeel is set to true, the control's painting scheme is determined by the static Default LookAndFeel. By default, all controls use settings exposed by the Default LookAndFeel.

To customize the Default LookAndFeel's settings, you can place the DefaultLookAndFeel component onto a form.

For the Default LookAndFeel the UseWindowsXPTheme, Style and SkinName settings can be customized, and these determine the painting scheme exposed by the Default LookAndFeel object. See the subsections below to learn how these options create the painting scheme exposed by the LookAndFeel object.

If you have multiple forms, do not place multiple DefaultLookAndFeel objects on your forms. Use a single DefaultLookAndFeel object per application. Customizing a single DefaultLookAndFeel affects the appearance settings of controls on all forms.

If a control's UserLookAndFeel.UseDefaultLookAndFeel property is set to false, the control's painting scheme is determined according to the UserLookAndFeel.UseWindowsXPTheme property's value.


The UseWindowsXPTheme setting

The UserLookAndFeel.UseWindowsXPTheme property specifies whether controls are painted using the native Windows theme. For a control, this setting is in effect when the control's UserLookAndFeel.UseDefaultLookAndFeel property is set to false. For the Default LookAndFeel object, this setting is always taken into account.

If the UseWindowsXPTheme property is set to true and a Windows native theme is available the UserLookAndFeel.Style property's value is ignored, and the control is painted using the current Windows native theme. Otherwise, the control's actual painting style is specified by the UserLookAndFeel.Style property.


The Style setting

The UserLookAndFeel.Style property lets you select the painting scheme (Flat, UltraFlat, Style3D, Office2003 or Skin).

A control's UserLookAndFeel.Style property is in effect in the following cases:
  • its UseDefaultLookAndFeel and UseWindowsXPTheme properties are set to false;
  • its UseDefaultLookAndFeel property is set to false, the UseWindowsXPTheme property is set to true, but an XP theme is not available.
The Default LookAndFeel's UserLookAndFeel.Style property is in effect in the following cases:
  • its UseWindowsXPTheme property is set to false;
  • its UseWindowsXPTheme property is set to true, but an XP theme is not available.

If the UserLookAndFeel.Style property is set to LookAndFeelStyle.Skin, the painting scheme is determined by the skin specified via the UserLookAndFeel.SkinName property.


The SkinName setting

This property specifies the name of the skin to use when the UserLookAndFeel.Style property is set to LookAndFeelStyle.Skin.

A skin is a set of bitmaps that determine how a control's elements should be painted in various states (normal, focused, hot-tracked, pressed, etc.). There are a number of skins that you can use in your applications. If a control is painted using a skin, it will appear identically on all machines (regardless of whether or not a system supports XP themes).


Summary

The following table summarizes information on how the various settings of a control's LookAndFeel object affect a control's appearance.

UseDefaultLookAndFeel
UseWindowsXPTheme
Style
SkinName
Image1
Image2
True
-
-
-
A control's painting scheme
is determined by the Default LookAndFeel's settings.
False
True
Flat
UltraFlat
Style3D
Office2003
-
Skin
Caramel
The Asphalt World
Liquid Sky
Coffee
Stardust
Glass Oceans
False
Flat
UltraFlat
Style3D
Office2003
-
Skin
Caramel
The Asphalt World
Liquid Sky
Coffee
Stardust
Glass Oceans

 

Note

1. A Windows native theme is currently applied.

2. When the Windows native theme is not available.

How would you rate this topic?​​​​​​​