TabPage.UseVisualStyleBackColor Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets a value indicating whether the TabPage background renders using the current visual style when visual styles are enabled.

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

public bool UseVisualStyleBackColor { get; set; }

Property Value

Type: System.Boolean

true to render the background using the current visual style; otherwise, false. The default is false.

The TabPage background uses the current visual style only when the UseVisualStyleBackColor and Application.RenderWithVisualStyles property values are both true.

When the UseVisualStyleBackColor and Application.RenderWithVisualStyles property values are both true and the Appearance property of the parent TabControl is Normal, the default value of the BackColor property is Transparent. Child controls that you place on the TabPage inherit the BackColor value by default, so this behavior causes the background of the child controls to render with the current visual style.

Changing the value of the BackColor property automatically sets the UseVisualStyleBackColor property to false. If you want the TabPage background to render using visual styles but you want the child controls to inherit a BackColor value that you specify, set the UseVisualStyleBackColor property after you set the BackColor property.

.NET Framework
Available since 2.0
Return to top
Show: