windowsforms-devexpress-dot-utils-dot-appearanceoptions.md
Gets or sets whether to use the AppearanceObject.BackColor property value.
Namespace : DevExpress.Utils
Assembly : DevExpress.Utils.v25.2.dll
NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core
[DefaultValue(false)]
[DXCategory("Appearance")]
[XtraSerializableProperty]
public virtual bool UseBackColor { get; set; }
<DefaultValue(False)>
<XtraSerializableProperty>
<DXCategory("Appearance")>
Public Overridable Property UseBackColor As Boolean
| Type | Default | Description |
|---|---|---|
| Boolean | false |
true to use the AppearanceObject.BackColor property value; false to use the background color specified by the parent appearance object.
|
You can access this nested property as listed below:
| Object Type | Path to UseBackColor |
|---|---|
| AppearanceObject |
.Options .UseBackColor
| | AppearanceOptions |
.Empty .UseBackColor
|
If the current appearance object has no parent, the AppearanceObject.BackColor property value is used regardless of the UseBackColor property setting. Please refer to the Look and Feel topic for details.
When an AppearanceObject’s style setting (for example, BackColor , ForeColor , Font and TextOptions.HAlignment ) is set to a non-default value, the corresponding Options.Use… option (for instance, Options.UseBackColor , Options.UseForeColor , Options.UseFont and Options.UseTextOptions ) is automatically set to true in the following cases:
In other cases, the Options.Use… options are not automatically enabled. You may need to enable these options manually for the style settings to be in effect.
The following code snippets (auto-collected from DevExpress Examples) contain references to the UseBackColor 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.
winforms-save-restore-splitter-position/CS/UserControl1.cs#L73
this.splitContainerControl1.Panel1.Appearance.BackColor = System.Drawing.Color.Lime;
this.splitContainerControl1.Panel1.Appearance.Options.UseBackColor = true;
this.splitContainerControl1.Panel1.Text = "splitContainerControl1_Panel1";
// Apply fill
if (appearance.Options.UseBackColor)
cell.ApplyFormatting(XlFill.SolidFill(appearance.BackColor));
winforms-save-restore-splitter-position/VB/UserControl1.vb#L73
splitContainerControl1.Panel1.Appearance.BackColor = System.Drawing.Color.Lime
splitContainerControl1.Panel1.Appearance.Options.UseBackColor = True
splitContainerControl1.Panel1.Text = "splitContainerControl1_Panel1"
' Apply fill
If appearance.Options.UseBackColor Then cell.ApplyFormatting(XlFill.SolidFill(appearance.BackColor))
' Apply font
See Also