This topic has not yet been rated - Rate this topic

RichTextBlock.Foreground property

Gets or sets the Brush to apply to the text contents of the RichTextBlock.

Syntax


public:
property Brush^ Foreground { 
   Brush^ get();
   void set (Brush^ value);
}


<RichTextBlock>
  <RichTextBlock.Foreground>
    singleBrush
  </RichTextBlock.Foreground>
</RichTextBlock>


<RichTextBlock Foreground="colorString"/>

XAML Values

singleBrush

A single object element for an object that derives from Brush. The object element is typically one of the following classes that are: LinearGradientBrush, ImageBrush, SolidColorBrush.

colorString

The Color for a SolidColorBrush expressed as a string value for the attribute. This can be a named color, an RGB value, or an ScRGB value. RGB or ScRGB values can also specify alpha information. For more information, see the "XAML Values" section in Brush.

Property value

Type: Brush

The brush used to apply to the text contents. The default is a SolidColorBrush with a Color value of Black.

Remarks

Set the Foreground property to specify the default brush to use for all text in the RichTextBlock. You can override this value for specific text elements in the RichTextBlock by setting the TextElement.Foreground property.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

RichTextBlock
TextElement.Foreground

 

 

Build date: 3/12/2013

© 2013 Microsoft. All rights reserved.