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 Brush Background { get; set; }

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.

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

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