windowsforms-devexpress-dot-xtraeditors-dot-windowsformssettings-9ab28604.md
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.v25.2.dll
NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core
public static DefaultBoolean TrackWindowsAccentColor { get; set; }
Public Shared Property TrackWindowsAccentColor As DefaultBoolean
| 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
|
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());
}
Imports DevExpress.XtraEditors
Shared Sub Main()
Application.EnableVisualStyles()
Application.SetCompatibleTextRenderingDefault(False)
WindowsFormsSettings.TrackWindowsAccentColor = DevExpress.Utils.DefaultBoolean.True
Application.Run(New Form1())
End Sub
The following example demonstrates how to obtain the system accent color:
using System.Drawing;
using DevExpress.Utils.Drawing.Helpers;
Color systemAccentColor = NativeMethods.GetWindowsAccentColor();
Imports System.Drawing
Imports DevExpress.Utils.Drawing.Helpers
Private systemAccentColor As Color = NativeMethods.GetWindowsAccentColor()
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);
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: Ribbon Skin Selectors.
See Also