Back to Devexpress

WinApplication.UseLightStyle Property

expressappframework-devexpress-dot-expressapp-dot-win-dot-winapplication-ec98c391.md

latest6.0 KB
Original Source

WinApplication.UseLightStyle Property

Enables the Light Style in a WinForms application.

Namespace : DevExpress.ExpressApp.Win

Assembly : DevExpress.ExpressApp.Win.v25.2.dll

NuGet Packages : DevExpress.ExpressApp.Win, DevExpress.ExpressApp.Win.Design

Declaration

csharp
[Browsable(false)]
public bool UseLightStyle { get; set; }
vb
<Browsable(False)>
Public Property UseLightStyle As Boolean

Property Value

TypeDescription
Boolean

true , if the Light Style is enabled for a WinForms application; otherwise, false.

|

Remarks

The UseLightStyle property is bound to DockingViewStyle.

UseLightStyle valueWindowsFormsSettings.DockingViewStyle value
trueDockingViewStyle.Light
falseDockingViewStyle.Default

The Template Kit enables the Light Style for all new XAF WinForms applications. For this purpose, the kit generates new projects with the FrameworkSettings.DefaultSettingsCompatibilityMode property set to Latest.

The Light Style uses the following templates:

  • LightStyleMainForm - in applications with the Standard UI;
  • LightStyleMainRibbonForm - in applications with the Ribbon UI.

The image below demonstrates the difference between a Layout with enabled and disabled Light Style:

The UseLightStyle property affects which built-in Controller XAF uses: the ChooseSkinController or the ConfigureSkinController.

UseLightStyle valueBuilt-in Controller
trueConfigureSkinController
falseChooseSkinController

The ConfigureSkinController provides new WinForms skin and palette runtime skin selectors for Bar UI and Ribbon UI.

WinForms UISkin selectorPalette selector
Bar UISkinDropDownButtonItemBarButtonItem with a Dropdown Gallery
Ribbon UISkinDropDownButtonItemSkinPaletteRibbonGalleryBarItem

Bar UI

Ribbon UI

If you want to enable the Light Style for an existing application, refer to the How to migrate a WinForms application to use the Light Style KB article.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the UseLightStyle property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

XAF_how-to-connect-different-data-models-to-several-databases-within-a-single-application/CS/XPO/.NetFramework/TwoXpoModelsForDifferentDatabases.Win/Program.cs#L27

csharp
DevExpress.ExpressApp.Utils.ImageLoader.Instance.UseSvgImages = true;
winApplication.UseLightStyle = true;
DevExpress.ExpressApp.Utils.ImageLoader.Instance.UseSvgImages = true;

XAF_how-to-connect-different-data-models-to-several-databases-within-a-single-application/VB/TwoXpoModelsForDifferentDatabases.Win/Program.vb#L27

vb
DevExpress.ExpressApp.Utils.ImageLoader.Instance.UseSvgImages = True
winApplication.UseLightStyle = True
DevExpress.ExpressApp.Utils.ImageLoader.Instance.UseSvgImages = True

See Also

WinApplication Class

WinApplication Members

DevExpress.ExpressApp.Win Namespace