Skip to main content

Scrollbar Annotation Behavior

Overview

You can display scrollbar annotations in a list box control to indicate the following items’ location:

  • focused item
  • selected items
  • checked items (the checked list box control only)
  • items corresponding to a search query (a search control should be attached to the list box control)

ScrollAnnotationBehavior2

Supported Controls

Options

  • Type — a set of flags that specify the enabled annotation types
  • Color — the annotation color (the default value depends on the current skin)
  • Alignment — the annotation alignment (the default value depends on the current skin)

ScrollAnnotationBehavior1

How to Attach the Behavior in Code

The code below shows how to enable scrollbar annotations for focused and selected rows in an image list box.

using DevExpress.Utils.Behaviors;

behaviorManager1.Attach<ScrollAnnotationsBehavior>(imageListBoxControl1, behavior => {
    behavior.Properties.Type = ScrollAnnotationType.Focus | ScrollAnnotationType.Selection;
});

Tip

You can handle the BaseListBoxControl.CustomDrawScroll event to draw custom annotations for specific scrollbar positions.

See Also