The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
TextElement.Background Property
.NET Framework 3.0
Gets or sets the Brush used to fill the background of content area.
Namespace: System.Windows.Documents
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace: http://schemas.microsoft.com/winfx/2006/xaml/presentation
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace: http://schemas.microsoft.com/winfx/2006/xaml/presentation
/** @property */ public Brush get_Background () /** @property */ public void set_Background (Brush value)
public function get Background () : Brush public function set Background (value : Brush)
For XAML information, see the Brush type.
Property Value
The brush used to fill the background of the content area, or null not to use a background brush. The default is a null brush.The following example shows how to set the Background attribute, using Paragraph as the example element.
<FlowDocumentReader> <FlowDocument> <Paragraph Background="Bisque" Foreground="DarkGreen" Padding="4" > <Run> This text has a foreground color of dark green, and a background color of bisque. </Run> </Paragraph> </FlowDocument> </FlowDocumentReader>
The following figure shows how this example renders.
The following example shows how to set the Background property programmatically.
Run run = new Run( "This text has a foreground color of dark green, and a background color of bisque."); Paragraph par = new Paragraph(run); par.Background = Brushes.Bisque; par.Foreground = Brushes.DarkGreen;
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.