TMlSkinScrollBar
The skinned scrollbar. It can be used on its own and is also what the memo, list view and scroll box use internally.
Notes
Positionis the current offset,Min–Maxthe range, andPageSizethe size of one page.SmallChangeis the step for an arrow click andLargeChangethe step for clicking the empty track.- The look comes from the
Scrollbar_…image properties: thumb and arrows each have normal, hot and pressed states, with separate sets for the horizontal and vertical bars. AutoHidehides the bar when the content does not need scrolling.
Example
From the demo MlSkin.Demo.360云盘.v3.0 (.dfm form file)
object mlsknscrlbr1: TMlSkinScrollBar
Left = 870
Top = 0
Width = 10
Height = 453
Scrollbar_bar_down = 'MlSkinScrollbar_bar_down'
Scrollbar_bar_highlight = 'MlSkinScrollbar_bar_highlight'
Scrollbar_bar_normal = 'MlSkinScrollbar_bar_normal'
Scrollbar_bkg = 'MlSkinScrollbar_bkg'
Scrollbar_arrowdown_normal = 'MlSkinScrollbar_arrowdown_normal'
Scrollbar_arrowup_normal = 'MlSkinScrollbar_arrowup_normal'
Scrollbar_horz_bkg = 'MlSkinScrollbar_horz_bkg'
Scrollbar_horzbar_down = 'MlSkinScrollbar_horzbar_down'
Scrollbar_horzbar_highlight = 'MlSkinScrollbar_horzbar_highlight'
Scrollbar_horzbar_normal = 'MlSkinScrollbar_horzbar_normal'
Scrollbar_arrowleft_normal = 'MlSkinScrollbar_arrowleft_normal'
Scrollbar_arrowright_normal = 'MlSkinScrollbar_arrowright_normal'
Scrollbar_arrowdown_down = 'MlSkinScrollbar_arrowdown_down'
Scrollbar_arrowdown_highlight = 'MlSkinScrollbar_arrowdown_highlight'
Scrollbar_arrowleft_down = 'MlSkinScrollbar_arrowleft_down'
Properties 29
| Name | Type | Default | Description |
|---|---|---|---|
Scrollbar_bar_down | TMlResID | — | Vertical scrollbar thumb, pressed state. |
Scrollbar_bar_highlight | TMlResID | — | Vertical scrollbar thumb, hot state. |
Scrollbar_bar_normal | TMlResID | — | Vertical scrollbar thumb, normal state. |
Scrollbar_bkg | TMlResID | — | Vertical scrollbar track background. |
Scrollbar_arrowdown_normal | TMlResID | — | Down arrow, normal state. |
Scrollbar_arrowup_normal | TMlResID | — | Up arrow, normal state. |
Scrollbar_horz_bkg | TMlResID | — | Horizontal scrollbar track background. |
Scrollbar_horzbar_down | TMlResID | — | Horizontal scrollbar thumb, pressed state. |
Scrollbar_horzbar_highlight | TMlResID | — | Horizontal scrollbar thumb, hot state. |
Scrollbar_horzbar_normal | TMlResID | — | Horizontal scrollbar thumb, normal state. |
Scrollbar_arrowleft_normal | TMlResID | — | Left arrow, normal state. |
Scrollbar_arrowright_normal | TMlResID | — | Right arrow, normal state. |
Scrollbar_arrowdown_down | TMlResID | — | Down arrow, pressed state. |
Scrollbar_arrowdown_highlight | TMlResID | — | Down arrow, hot state. |
Scrollbar_arrowleft_down | TMlResID | — | Left arrow, pressed state. |
Scrollbar_arrowleft_highlight | TMlResID | — | Left arrow, hot state. |
Scrollbar_arrowright_down | TMlResID | — | Right arrow, pressed state. |
Scrollbar_arrowright_highlight | TMlResID | — | Right arrow, hot state. |
Scrollbar_arrowup_down | TMlResID | — | Up arrow, pressed state. |
Scrollbar_arrowup_highlight | TMlResID | — | Up arrow, hot state. |
AutoHide | Boolean | False | Hides the scrollbar automatically when the content does not need scrolling. |
CanFocused | Boolean | False | Whether the control can take focus. With it off, clicking does not steal focus and Tab skips it. |
Kind | TScrollBarKind | sbHorizontal | Scrollbar orientation: horizontal or vertical. |
PageSize | Integer | 0 | Size of one page, which also sets how long the thumb is. |
Min | Integer | 0 | Lower bound of the scroll range. |
Max | Integer | 100 | Upper bound of the scroll range. |
Position | Integer | 0 | Current position of the scrollbar. |
SmallChange | Integer | 1 | How far one arrow click scrolls. |
LargeChange | Integer | 1 | How far a click on the empty track scrolls, i.e. one page. |
Events 6
| Name | Type | Default | Description |
|---|---|---|---|
OnChange | TNotifyEvent | — | Fires when the content changes. |
OnLastChange | TNotifyEvent | — | Fires when scrolling reaches the end, which is a good place to load more content. |
OnUpButtonClick | TNotifyEvent | — | Fires when the up arrow is clicked. |
OnDownButtonClick | TNotifyEvent | — | Fires when the down arrow is clicked. |
OnPageUp | TNotifyEvent | — | Fires when the user pages up. |
OnPageDown | TNotifyEvent | — | Fires when the user pages down. |
Properties of TMlSkinCustomControl 5
| Name | Type | Default | Description |
|---|---|---|---|
About | TMlAboutInfo | — | A design-time property: double-clicking it in the Object Inspector opens the MLSkin about box with the component version. It has no effect at run time and is not stored in the .dfm. |
Transparent | Boolean | True | Transparent background: the control skips its own fill and shows the form background (image or color) instead. |
Color | TColor | clWhite | Background color of the control; ignored while Transparent is on. |
AutoInvalidate | Boolean | False | Repaints automatically when the content changes. Turn it on if property changes do not show up. |
EraseBackground | Boolean | False | Whether the background is erased before painting; worth toggling if the control flickers. |
Events of TMlSkinCustomControl 4
| Name | Type | Default | Description |
|---|---|---|---|
OnDPIChanged | TMlDPIChangedEvent | — | Fires when the screen DPI changes, for example when the window moves to a monitor with a different scaling — a good place to re-adjust anything you draw yourself. |
OnBackgroundChanging | TMlBackgroundEvent | — | Fires just before the background changes, giving you a chance to adjust what is drawn. |
OnBackgroundChanged | TMlCustomDrawEvent | — | Fires after the background has been drawn, so you can paint on top of it. |
OnVisibleChanged | TNotifyEvent | — | Fires when the control is shown or hidden. |
Only the properties and events MLSkin adds are listed here. Standard VCL properties such as Align, Anchors, Font and OnClick are available too and behave exactly as on the stock controls.
Offline helpA PDF / CHM version is available for offline reading.