HypernovaDesktop Components · docs
Binarymission
WinForms › Scroll Bar Marker › ScrollBarShapeMark

ScrollBarShapeMark

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

A coloured rectangle or oval on a marker scroll bar, centred on the position it marks – the usual way to show an error, a warning or a search hit.

public class ScrollBarShapeMark : ScrollBarMarkBase

Inherits from / implements: ScrollBarMarkBase

Remarks

Set at least ScrollBarMarkBase.Value, ScrollBarMarkBase.Size and StartColor: with the default empty size or colour nothing is visible.

Examples

searchBar.ScrollBarMarks.Add(new ScrollBarShapeMark
{
    Value = matchLine,
    Size = new SizeF(10, 3),
    Alignment = ScrollBarMarkAlignment.Center,
    StartColor = Color.Gold,
    ShouldDrawBorder = true,
    BorderColor = Color.DarkGoldenrod,
    ToolTipInfo = "Match: \"" + searchText + "\"",
});
searchBar.Invalidate();

Members at a glance

Properties
EndColorGets or sets the second colour of the mark's gradient.
LinearGradientAngleGets or sets the direction of the mark's gradient.
RenderModeGets or sets whether the mark is filled with StartColor alone or with a gradient to EndColor.
ShapeGets or sets the mark's shape.
StartColorGets or sets the mark's fill colour, or the first colour of its gradient.
Methods
DisposeReleases the brush the mark may hold. The same as ScrollBarMarkBase.Dispose().
DisposeReleases the brush the mark may hold, however the mark is disposed – also through IDisposable or a using statement.

Properties

EndColor

public Color EndColor

Gets or sets the second colour of the mark's gradient.

Value
The default is Color.Empty. Used only when RenderMode is ScrollBarShapedMarkMode.FillGradient.

LinearGradientAngle

public float LinearGradientAngle

Gets or sets the direction of the mark's gradient.

Value
In degrees clockwise from left-to-right: 0 runs StartColor to EndColor from left to right, 90 from top to bottom. The default is 0.

RenderMode

public ScrollBarShapedMarkMode RenderMode

Gets or sets whether the mark is filled with StartColor alone or with a gradient to EndColor.

Value
The default is ScrollBarShapedMarkMode.FillSolid.

Shape

public ScrollBarShapedMarkShape Shape

Gets or sets the mark's shape.

Value
The default is ScrollBarShapedMarkShape.Rectangle.

StartColor

public Color StartColor

Gets or sets the mark's fill colour, or the first colour of its gradient.

Value
The default is Color.Empty, which is transparent; set a colour to see the mark.
See also

Methods

Dispose

public new void Dispose()

Releases the brush the mark may hold. The same as ScrollBarMarkBase.Dispose().

Dispose

protected override void Dispose(bool disposing)

Releases the brush the mark may hold, however the mark is disposed – also through IDisposable or a using statement.

Parameters
disposing
true when called from ScrollBarMarkBase.Dispose().