Skip to content

Foreground Property

Description

Gets or sets a brush that describes the foreground color.

Property Type

Read-write property

Syntax (Visual Basic)

Public Property Foreground() As [MarkupBrush](XtremeMarkup~MarkupBrush.md)

Return Type

A MarkupBrush that paints the foreground of the control.

Remarks

This property only affects a control whose template uses the Foreground property as a parameter. On other controls, this property has no impact.

The CreateSolidBrush method is used to create a solid color brush to paint the foreground for a TextBlock.

For example:

MarkupControl1.Foreground = Context.CreateSolidBrush(vbYellow)

Note that CreateSolidBrush creates a MarkupSolidColorBrush object that stores the color value.

To retrieve the current color, use the MarkupSolidColorBrush.Color property.

For example:

Print MarkupControl1.Foreground.Color

See Also


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.