Notes
AutoSlider starts automatic paging, SliderInterval is how long each image stays and SliderSpeed how fast it slides.
SliderType picks the transition, and AutoImageSize fits the images to the control.
ButtonLeft and ButtonRight supply the paging button images, each with its own click event.
- Moving to another image fires
OnSliderPageChanged, and the dots at the bottom fire OnDotButtonClick.
Example
From the demo MlSkin.Demo.图片轮播滑动显示.v4.6 (.dfm form file)
object sld1: TMlSkinImageSlider
Left = 102
Top = 48
Width = 632
Height = 340
ButtonLeft.Active = True
ButtonLeft.Image = 'MlSkinSlides'
ButtonLeft.Normal = 2
ButtonLeft.Hot = 0
ButtonLeft.Disable = 0
ButtonLeft.Count = 4
ButtonLeft.Pressed = 2
ButtonRight.Active = True
ButtonRight.Image = 'MlSkinSlides'
ButtonRight.Normal = 3
ButtonRight.Hot = 1
ButtonRight.Disable = 0
ButtonRight.Count = 4
ButtonRight.Pressed = 2
Images = <
Properties 15
| Name | Type | Default | Description |
|---|
AutoImageSize | Boolean | True | Scales the images to the control size automatically. |
AutoSlider | Boolean | True | Pages to the next image automatically. |
ButtonLeft | TPngPictures | — | Image for the previous-image button. |
ButtonRight | TPngPictures | — | Image for the next-image button. |
Images | TMlSkinSliderItemCollection | — | The ImageList the icons come from. |
SliderInterval | Integer | 3000 | How long each image stays, in milliseconds. |
SliderSpeed | Integer | 50 | How fast the slide transition runs. |
SliderType | TSliderType | stLeftRight | Transition style: sliding, fading and so on. |
Options | TImageSliderOptions | [soLeftRightButtonVisible, soDotButtonVisible] | A group of options for this control; expand it to set them individually. |
Alpha | Byte | 192 | Opacity: 0 fully transparent, 255 opaque. |
BorderAlpha | Byte | 255 | Border opacity from 0 (invisible) to 255 (solid). |
BorderSides | TSides | — | Which border edges are drawn — any combination of top, bottom, left and right. |
BorderColor | TColor | $00D9CBBA | Border color. |
Color | TColor | clWhite | Background color of the control; ignored while Transparent is on. |
DoubleBorder | Boolean | True | Double border: draws a second line inside the border. |
Events 5
| Name | Type | Default | Description |
|---|
OnLeftButtonClick | TNotifyEvent | — | Fires when the previous-image button is clicked. |
OnRightButtonClick | TNotifyEvent | — | Fires when the next-image button is clicked. |
OnDotButtonClick | TNotifyEvent | — | Fires when one of the dot indicators at the bottom is clicked. |
OnItemClick | TItemClickEvent | — | Fires when an item is clicked. |
OnSliderPageChanged | TNotifyEvent | — | Fires after the slider moves to another image. |
Events of TMlSkinCustomPanel 1
| Name | Type | Default | Description |
|---|
OnCustomDraw | TMlCustomDrawEvent | — | Custom draw event: paint your own content after the control has drawn itself. |
Properties of TMlSkinCustomControl 4
| 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. |
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.