Back to Devexpress

UserLookAndFeel.ActiveLookAndFeel Property

windowsforms-devexpress-dot-lookandfeel-dot-userlookandfeel-fd9c48a2.md

latest8.2 KB
Original Source

UserLookAndFeel.ActiveLookAndFeel Property

Gets the actual UserLookAndFeel object currently applied.

Namespace : DevExpress.LookAndFeel

Assembly : DevExpress.Utils.v25.2.dll

NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core

Declaration

csharp
[Browsable(false)]
public virtual UserLookAndFeel ActiveLookAndFeel { get; }
vb
<Browsable(False)>
Public Overridable ReadOnly Property ActiveLookAndFeel As UserLookAndFeel

Property Value

TypeDescription
UserLookAndFeel

A UserLookAndFeel object currently applied.

|

Remarks

The currently applied look and feel is determined according to the values of the UserLookAndFeel.UseDefaultLookAndFeel and UserLookAndFeel.ParentLookAndFeel properties.

|

Property values

|

Description

| | --- | --- | |

UserLookAndFeel.UseDefaultLookAndFeel is set to true

UserLookAndFeel.ParentLookAndFeel specifies a non-null value

|

Look and feel settings are controlled by a parent LookAndFeel object assigned to the UserLookAndFeel.ParentLookAndFeel property. In turn, these settings are determined by the UserLookAndFeel.UseDefaultLookAndFeel and UserLookAndFeel.ParentLookAndFeel properties of the parent LookAndFeel.

ActiveLookAndFeel will return the parent LookAndFeel whose settings are currently applied.

Specifying a parent LookAndFeel object can be useful to provide centralized management of controls’ appearance.

| |

UserLookAndFeel.UseDefaultLookAndFeel is set to true

UserLookAndFeel.ParentLookAndFeel specifies a null value

|

The current look and feel settings are controlled by a static Default LookAndFeel object and the ActiveLookAndFeel property returns this object. You can access the Default LookAndFeel via the static UserLookAndFeel.Default property or by placing and customizing a DefaultLookAndFeel component. The UserLookAndFeel.Default property can only be accessed via code, while the DefaultLookAndFeel component can be customized at design and runtime.

| |

UserLookAndFeel.UseDefaultLookAndFeel is set to false

|

Look and feel settings are controlled by the current UserLookAndFeel object. ActiveLookAndFeel returns a reference to the current object.

Changing properties of the Default LookAndFeel enables you to have all controls in your application looking alike. This is the case, if UserLookAndFeel.UseDefaultLookAndFeel is set to true and control’s style properties are set to Default (see the UserLookAndFeel topic for more information).

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the ActiveLookAndFeel 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-combobox-with-close-and-clear-buttons-in-dropdown/CS/WindowsApplication3/CustomPopupBaseSizeableFormPainter.cs#L32

csharp
{
    SkinElementInfo skin = new SkinElementInfo(CommonSkins.GetSkin(DevExpress.LookAndFeel.UserLookAndFeel.Default.ActiveLookAndFeel)[CommonSkins.SkinHighlightedItem], rect);
    br = new SolidBrush(DevExpress.LookAndFeel.LookAndFeelHelper.GetSystemColor(

draw-form-title-manually/CS/WindowsApplication3/Main.cs#L25

csharp
{
    return new MyFormPainter(this, DevExpress.LookAndFeel.UserLookAndFeel.Default.ActiveLookAndFeel);
}

winforms-grid-custom-button-in-column-header/CS/WindowsApplication3/ColumnHeaderExtender.cs#L41

csharp
private void CreateButtonPainter() {
    customButtonPainter = new SkinEditorButtonPainter(DevExpress.LookAndFeel.UserLookAndFeel.Default.ActiveLookAndFeel);
}

winforms-combobox-with-close-and-clear-buttons-in-dropdown/VB/WindowsApplication3/CustomPopupBaseSizeableFormPainter.vb#L28

vb
If isHot Then
    Dim skin As SkinElementInfo = New SkinElementInfo(CommonSkins.GetSkin(DevExpress.LookAndFeel.UserLookAndFeel.Default.ActiveLookAndFeel)(CommonSkins.SkinHighlightedItem), rect)
    br = New SolidBrush(DevExpress.LookAndFeel.LookAndFeelHelper.GetSystemColor(DevExpress.LookAndFeel.UserLookAndFeel.Default.ActiveLookAndFeel, SystemColors.HotTrack))

draw-form-title-manually/VB/WindowsApplication3/Main.vb#L23

vb
Protected Overrides Function CreateFormBorderPainter() As FormPainter
    Return New MyFormPainter(Me, DevExpress.LookAndFeel.UserLookAndFeel.Default.ActiveLookAndFeel)
End Function

winforms-grid-custom-button-in-column-header/VB/WindowsApplication3/ColumnHeaderExtender.vb#L41

vb
Private Sub CreateButtonPainter()
    customButtonPainter = New SkinEditorButtonPainter(DevExpress.LookAndFeel.UserLookAndFeel.Default.ActiveLookAndFeel)
End Sub

See Also

Default

ParentLookAndFeel

UseDefaultLookAndFeel

DefaultLookAndFeel

UserLookAndFeel Class

UserLookAndFeel Members

DevExpress.LookAndFeel Namespace