Skip to main content
All docs
V24.2

WindowsFormsSettings.TrackWindowsAccentColor Property

Gets or sets whether to use the Accent Color setting in Windows OS and apply it to all color palettes of vector skins except the High Contrast skin.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.Utils.v24.2.dll

Declaration

public static DefaultBoolean TrackWindowsAccentColor { get; set; }

Property Value

Type Description
DefaultBoolean

DefaultBoolean.True to use the Accent Color setting in Windows OS and apply it to all color palettes of vector skins; otherwise, DefaultBoolean.False or DefaultBoolean.Default.

Available values:

Name Description Return Value
True

The value is true.

0

False

The value is false.

1

Default

The value is specified by a global option or a higher-level object.

2

Remarks

Important

The WindowsFormsSettings.TrackWindowsAccentColor setting does not work in the High Contrast skin.

using DevExpress.XtraEditors;

static void Main() {
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    WindowsFormsSettings.TrackWindowsAccentColor = DevExpress.Utils.DefaultBoolean.True;
    Application.Run(new Form1());
}

Track Windows Accent Color - WinForms UI Controls

The following example demonstrates how to obtain the system accent color:

using System.Drawing;
using DevExpress.Utils.Drawing.Helpers;

Color systemAccentColor = NativeMethods.GetWindowsAccentColor();

Custom Accent Color

Use the SetAccentColor method to specify a custom accent color (that takes priority over the system accent color).

The following example demonstrates how to reset the accent color:

DevExpress.XtraEditors.WindowsFormsSettings.SetAccentColor(System.Drawing.Color.Empty);

Note

“The Bezier” skin supports the second accent color. Other skins do not support the second accent color.

Use the SetAccentColor2 method to specify the second accent color.

Tip

Read the following topic for information on how to display pre-designed Ribbon UI commands that correspond to advanced skin settings: Add and Customize the Ribbon Skin List and Skin Gallery.

Display Advanced Skin Options

See Also