ScrollBarMarkBase
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 | |
|---|---|
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. |
BorderColor | Gets or sets the colour of the mark's outline. |
BorderThickness | Gets or sets the width of the mark's outline. |
IsToolTipBalloon | Gets or sets whether the mark's tool tip is drawn as a balloon with a pointer rather than a plain box. |
ShouldDrawBorder | Gets or sets whether an outline is drawn around the mark. |
Size | Gets or sets the mark's size on the bar. |
Tag | Gets or sets any object you want to keep with the mark, such as the error or bookmark it stands for. |
ToolTipIcon | Gets or sets the icon shown beside the mark's tool tip title. |
ToolTipInfo | Gets or sets the text of the tool tip shown when the pointer rests on the mark. |
ToolTipTitle | Gets or sets the bold title above the mark's tool tip text. |
Value | Gets or sets the position the mark belongs to, in the bar's range units – the same units as the bar's
Position. |
| Methods | |
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 | Releases what the mark holds. A derived mark that holds a brush, an image or the like overrides this. |
Properties
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
Gets or sets the colour of the mark's outline.
- Value
- The default is
Color.Empty, which draws nothing; set a colour along withShouldDrawBorder.
BorderThickness
Gets or sets the width of the mark's outline.
- Value
- In pixels. The default, 0, draws a one-pixel line.
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
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
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
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
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 aToolTipTitle.
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
Gets or sets the bold title above the mark's tool tip text.
- Value
- The default is
null: no title. Shown only withToolTipInfo.
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
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
Releases what the mark holds. A derived mark that holds a brush, an image or the like overrides this.
Parameters
disposingtruewhen called fromDispose().