Intersoft ClientUI Documentation
Foreground Property (FlowDocument)



Gets or sets the Brush to apply to the text contents of the document.
Syntax
Public Property Foreground As Brush
Dim instance As FlowDocument
Dim value As Brush
 
instance.Foreground = value
 
value = instance.Foreground
public Brush Foreground {get; set;}
public:
property Brush^ Foreground {
   Brush^ get();
   void set (    Brush^ value);
}
Remarks

Global formatting can be applied to all elements in FlowDocument by configuring it in FlowDocument object. You can set a series of font configuration, such as FontFamily, FontSize, FontStretch, FontStyle, FontWeight to the document. In addition, you can use Foreground property to set the default foreground color for all document elements. You can use TextAlignment property to set default text alignment, as well as LineSpacingType and LineSpacing properties to specify the default line spacing configuration. Note that the global configuration will be overridden if there is individual configuration specified in element level.

The following code example shows a simple FlowDocument with various font formatting.

XAML
Copy Code
<Intersoft:FlowDocument Foreground="Blue" FontFamily="Lucida Sans Unicode" 
                        FontSize="20">
    <Intersoft:Paragraph>
        <Intersoft:Run>
            Hello World !
        </Intersoft:Run>
    </Intersoft:Paragraph>
    <Intersoft:Section>
        <Intersoft:Paragraph>
            <Intersoft:Run>
                This is my first flow document.
            </Intersoft:Run>
        </Intersoft:Paragraph>
    </Intersoft:Section>
</Intersoft:FlowDocument>

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

FlowDocument Class
FlowDocument Members

Send Feedback