HypernovaDesktop Components · docs
Binarymission
WinForms › Office Window › BrushContainer

BrushContainer

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WinForms.Controls.Windows

Holds a brush for a ModernChromeWindow property, so the designer can set a plain colour while code can set any brush, such as a gradient.

public sealed class BrushContainer

Examples

window.WindowChromeTitleTextBrush = new BrushContainer { Color = Color.Gold };          // a plain colour
window.BackgroundHotCloseCommandButton = new BrushContainer
{
    Brush = new LinearGradientBrush(new Rectangle(0, 0, 46, 30), Color.Tomato, Color.DarkRed, 90f)
};

Members at a glance

Constructors
BrushContainerCreates a container holding a solid Color.SlateGray brush.
Properties
BrushGets or sets the brush that is painted with.
ColorGets or sets a plain colour; setting it replaces Brush with a solid brush of that colour.
Methods
ToStringReturns a short description of this BrushContainer, which is what the designer shows for the property.

Constructors

BrushContainer

public BrushContainer()

Creates a container holding a solid Color.SlateGray brush.

Properties

Brush

public Brush Brush

Gets or sets the brush that is painted with.

Value
A solid brush of Color unless you set another. Not saved by the designer: set it in code.

Color

public Color Color

Gets or sets a plain colour; setting it replaces Brush with a solid brush of that colour.

Value
The default is Color.SlateGray. It does not follow a Brush set afterwards.

Methods

ToString

public override string ToString()

Returns a short description of this BrushContainer, which is what the designer shows for the property.