TMlSkinImageSlider

An image slider that pages through several pictures, optionally on its own — the usual choice for a banner or a photo strip.

Category
Image lists
Unit
uMlSkinImageSlider.pas
Inherits from
TMlSkinCustomImageSlider → TMlSkinCustomPanel → TMlSkinCustomControl

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

NameTypeDefaultDescription
AutoImageSizeBooleanTrueScales the images to the control size automatically.
AutoSliderBooleanTruePages to the next image automatically.
ButtonLeftTPngPictures—Image for the previous-image button.
ButtonRightTPngPictures—Image for the next-image button.
ImagesTMlSkinSliderItemCollection—The ImageList the icons come from.
SliderIntervalInteger3000How long each image stays, in milliseconds.
SliderSpeedInteger50How fast the slide transition runs.
SliderTypeTSliderTypestLeftRightTransition style: sliding, fading and so on.
OptionsTImageSliderOptions[soLeftRightButtonVisible, soDotButtonVisible]A group of options for this control; expand it to set them individually.
AlphaByte192Opacity: 0 fully transparent, 255 opaque.
BorderAlphaByte255Border opacity from 0 (invisible) to 255 (solid).
BorderSidesTSides—Which border edges are drawn — any combination of top, bottom, left and right.
BorderColorTColor$00D9CBBABorder color.
ColorTColorclWhiteBackground color of the control; ignored while Transparent is on.
DoubleBorderBooleanTrueDouble border: draws a second line inside the border.

Events 5

NameTypeDefaultDescription
OnLeftButtonClickTNotifyEvent—Fires when the previous-image button is clicked.
OnRightButtonClickTNotifyEvent—Fires when the next-image button is clicked.
OnDotButtonClickTNotifyEvent—Fires when one of the dot indicators at the bottom is clicked.
OnItemClickTItemClickEvent—Fires when an item is clicked.
OnSliderPageChangedTNotifyEvent—Fires after the slider moves to another image.
Events of TMlSkinCustomPanel 1
NameTypeDefaultDescription
OnCustomDrawTMlCustomDrawEvent—Custom draw event: paint your own content after the control has drawn itself.
Properties of TMlSkinCustomControl 4
NameTypeDefaultDescription
AboutTMlAboutInfo—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.
TransparentBooleanTrueTransparent background: the control skips its own fill and shows the form background (image or color) instead.
AutoInvalidateBooleanFalseRepaints automatically when the content changes. Turn it on if property changes do not show up.
EraseBackgroundBooleanFalseWhether the background is erased before painting; worth toggling if the control flickers.
Events of TMlSkinCustomControl 4
NameTypeDefaultDescription
OnDPIChangedTMlDPIChangedEvent—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.
OnBackgroundChangingTMlBackgroundEvent—Fires just before the background changes, giving you a chance to adjust what is drawn.
OnBackgroundChangedTMlCustomDrawEvent—Fires after the background has been drawn, so you can paint on top of it.
OnVisibleChangedTNotifyEvent—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.