[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Collapse]Ribbon, Bars and Menu
   [Expand]Popup Menus
    Radial Menu
   [Collapse]Common Features
    [Collapse]Appearance and Look and Feel
      Look And Feel and Skinning
      Appearance Inheritance Options
      Alpha Blending and Background Images
      Bar and Docking Controllers (Customizing Default View and Behavior Settings)
      Bar and Ribbon Glyph Skinning
     Stub Glyphs
     The List of Bar Items and Links
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  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]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Appearance Inheritance Options

The XtraBars suite allows you to inherit appearance settings, the subject of this topic. Inheriting appearance options means that if the parent's appearance settings are changed this will immediately be reflected by all its children.

Expanded Appearance Inheritance in XtraBars

By default, the appearance and customization settings for all the dock controls and bars within your application's forms are provided by the Default BarAndDocking Controller. If you need to provide different settings for the dock controls and bars that belong to a particular dock manager/BarManager, you should use the BarAndDockingController component. Finally, to give an individual bar or dock control the desired look, you should override the BarAndDocking Controller's appearance settings using the appearance inheritance options provided by the appearance objects.

The image below illustrates the appearance inheritance structure.

Settings inherited from the BarAndDocking Controller are specified by the options listed in the AppearanceObject.Options property. You should disable options that correspond to inherited appearance settings. For example, if you need to use the controller's foreground color, set the AppearanceOptions.UseForeColor property to false. For detailed information on appearance options, see the AppearanceOptions class description.

The following table lists the available appearance options.

Option Description
AppearanceOptions.UseBackColor Gets or sets whether to use the AppearanceObject.BackColor property value.
AppearanceOptions.UseBorderColor Gets or sets whether to use the AppearanceOptions.UseBorderColor property value.
AppearanceOptions.UseFont Gets or sets whether to use the AppearanceOptions.UseFont property value.
AppearanceOptions.UseForeColor Gets or sets whether to use the AppearanceOptions.UseForeColor property value.
AppearanceOptions.UseImage Gets or sets whether to use the AppearanceOptions.UseImage property value.

Expanded Using Appearance Options

Let's consider an example of using appearance options when customizing bars.

When a new Bar object is being initialized, its Bar.Appearance property is automatically set to a new AppearanceObject instance. By default, all appearance options are disabled, and the bar's appearance settings are determined by the BarAndDockingController assigned to the Bar Manager that owns the current bar. This controller provides the appearance and customization options for the bars belonging to the current BarManager. If the BarAndDocking Controller is not specified (the BarManager's BarManager.Controller property is set to a null reference), the appearance settings are specified by the default BarAndDocking Controller.

Please refer to the Bar and Docking Controllers (Customizing Default View and Behavior Settings) topic for detailed information on using the BarAndDocking Controller.

The image below shows the bFile bar's look and feel. The background's settings are inherited from the BarAndDocking Controller's bar appearance settings.

To override the BarAndDocking Controller's appearance settings for an individual bar, you should set the bar's desired appearance properties to true. The image below shows how to override the BarAndDocking Controller's background settings.

The sample code below demonstrates how this can be performed via code.

Expanded See Also

Is this topic helpful?​​​​​​​