Background Property

Panel.Background Property


Gets or sets a Brush that is used to fill the area between the borders of a Panel.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

Public Property Background As Brush

Property Value

Type: System.Windows.Media.Brush

A Brush. This default value is null.

Panel elements do not receive mouse or stylus events if a Background is not defined. If you need to handle mouse or stylus events but do not want a background for your Panel, use Transparent.

Legacy Code Example

The following example sets the Background of a Grid to a RadialGradientBrush.

Code snippet is not found. Confirm that the code snippet name 'PanelBackground' is correct.

.NET Framework
Available since 3.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
© 2015 Microsoft