Skip to content

Background Property

See Also

MarkupGrid Object | MarkupContext Object | CreateSolidBrush Method | MarkupSolidColorBrush Object | Color Property

See Also


Description

Gets or sets a MarkupBrush that is used to fill the area between the borders of a MarkupPanel.

Property Type

Read-write property

Syntax (Visual Basic)

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

Return Type

A MarkupBrush containing the background color of the panel. Default is Nothing (Transparent).

Remarks

The CreateSolidBrush method is used to create a solid color brush to paint the background for a panel.

For example:

StackPanel.Background = Context.CreateSolidBrush(vbYellow)

Note that CreateSolidBrush creates a MarkupSolidColorBrush object that stores the color value. A value of Nothing sets the background to Transparent.

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

For example:

Print StackPanel.Background.Color

MarkupPanel elements do not receive mouse events if a Background is not defined. If you need to handle mouse events but do not want a background for your MarkupPanel, use Transparent.

Example

StackPanel.Background = Context.CreateSolidBrush(vbYellow)

See Also

MarkupGrid Object | MarkupContext Object | CreateSolidBrush Method | MarkupSolidColorBrush Object | Color Property


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