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

ScrollBarMarkBase

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

What every scroll bar mark has: the position it marks, its size and alignment, an optional border, a tool tip and a tag for your own data.

public class ScrollBarMarkBase : IDisposable

Inherits from / implements: IDisposable

Remarks

Add the derived marks – ScrollBarShapeMark, ScrollBarRangeMark, ScrollBarImageMark – to the ScrollBarMarks list of a MarkerVerticalScrollBar or MarkerHorizontalScrollBar. A plain ScrollBarMarkBase in the list is not drawn.

Members at a glance

Properties
AlignmentGets or sets where the mark sits across the bar: left, centre or right on a vertical bar; top, middle or bottom on a horizontal one.
BorderColorGets or sets the colour of the mark's outline.
BorderThicknessGets or sets the width of the mark's outline.
IsToolTipBalloonGets or sets whether the mark's tool tip is drawn as a balloon with a pointer rather than a plain box.
ShouldDrawBorderGets or sets whether an outline is drawn around the mark.
SizeGets or sets the mark's size on the bar.
TagGets or sets any object you want to keep with the mark, such as the error or bookmark it stands for.
ToolTipIconGets or sets the icon shown beside the mark's tool tip title.
ToolTipInfoGets or sets the text of the tool tip shown when the pointer rests on the mark.
ToolTipTitleGets or sets the bold title above the mark's tool tip text.
ValueGets or sets the position the mark belongs to, in the bar's range units – the same units as the bar's Position.
Methods
DisposeReleases the mark. A base mark holds nothing that needs releasing; it is there so a mark list can be disposed as a whole.
DisposeReleases what the mark holds. A derived mark that holds a brush, an image or the like overrides this.

Properties

Alignment

public ScrollBarMarkAlignment Alignment

Gets or sets where the mark sits across the bar: left, centre or right on a vertical bar; top, middle or bottom on a horizontal one.

Value
The default, ScrollBarMarkAlignment.Default, is the left edge of a vertical bar and the top edge of a horizontal one.
Remarks

The values for the other orientation (ScrollBarMarkAlignment.Top on a vertical bar, for example) are treated as ScrollBarMarkAlignment.Default.

BorderColor

public Color BorderColor

Gets or sets the colour of the mark's outline.

Value
The default is Color.Empty, which draws nothing; set a colour along with ShouldDrawBorder.

BorderThickness

public float BorderThickness

Gets or sets the width of the mark's outline.

Value
In pixels. The default, 0, draws a one-pixel line.

IsToolTipBalloon

public bool IsToolTipBalloon

Gets or sets whether the mark's tool tip is drawn as a balloon with a pointer rather than a plain box.

Value
The default is false.

ShouldDrawBorder

public bool ShouldDrawBorder

Gets or sets whether an outline is drawn around the mark.

Value
The default is false.
Remarks

An oval mark gets an oval outline. A right- or bottom-aligned mark is moved in by BorderThickness so the outline stays on the bar.

See also

Size

public SizeF Size

Gets or sets the mark's size on the bar.

Value
Width by height, in pixels, not scaled with the display. The default, Empty, draws nothing for a shape mark.
Remarks

A range mark uses only the size across the bar (the width on a vertical bar, the height on a horizontal one); its length comes from its two values and is written back here when it is drawn.

An image mark uses it only with ImageMarkSizingMode.UserSize.

Tag

public object Tag

Gets or sets any object you want to keep with the mark, such as the error or bookmark it stands for.

Value
The default is null. The bar never reads it.

ToolTipIcon

public ToolTipIcon ToolTipIcon

Gets or sets the icon shown beside the mark's tool tip title.

Value
The default is None. Windows shows the icon only when there is a ToolTipTitle.

ToolTipInfo

public string ToolTipInfo

Gets or sets the text of the tool tip shown when the pointer rests on the mark.

Value
The default is null: no tool tip.
See also

ToolTipTitle

public string ToolTipTitle

Gets or sets the bold title above the mark's tool tip text.

Value
The default is null: no title. Shown only with ToolTipInfo.

Value

public double Value

Gets or sets the position the mark belongs to, in the bar's range units – the same units as the bar's Position.

Value
The default is 0.
Remarks

A shape or image mark is centred on this point of the track; a range mark starts here. Clicking the mark (with the bar's ShouldScrollUponBookmarkClick on) scrolls the bar to this position.

Methods

Dispose

public void Dispose()

Releases the mark. A base mark holds nothing that needs releasing; it is there so a mark list can be disposed as a whole.

Dispose

protected virtual void Dispose(bool disposing)

Releases what the mark holds. A derived mark that holds a brush, an image or the like overrides this.

Parameters
disposing
true when called from Dispose().