Export (0) Print
Expand All

Application.RenderWithVisualStyles Property

Gets a value specifying whether the current application is drawing controls with visual styles.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

'Declaration
Public Shared ReadOnly Property RenderWithVisualStyles As Boolean

Property Value

Type: System.Boolean
true if visual styles are enabled for controls in the client area of application windows; otherwise, false.

If you are drawing a custom control, use this property to decide whether to draw the control with or without visual styles, so that its appearance is consistent with other controls in the application.

The following table shows the four conditions that must exist for RenderWithVisualStyles to return true.

Condition

Description

The operating system supports visual styles

To verify this condition separately, use the IsSupportedByOS property of the VisualStyleInformation class.

The user has enabled visual styles in the operating system

To verify this condition separately, use the IsEnabledByUser property of the VisualStyleInformation class.

Visual styles are enabled in the application

Visual styles can be enabled in an application by calling the EnableVisualStyles method or by using an application manifest that specifies that ComCtl32.dll version 6 or later will be used to draw controls.

Visual styles are being used to draw the client area of application windows

To verify this condition separately, use the VisualStyleState property of the Application class and verify that it has the value VisualStyleState.ClientAreaEnabled or VisualStyleState.ClientAndNonClientAreasEnabled.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft