Skip to main content
A newer version of this page is available. .

Scrollbar Annotation Behavior

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

Behavior 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;
});

Note

Tip You can handle the BaseListBoxControl.CustomDrawScroll event to draw custom annotations for specific scrollbar positions (see ScrollBarBase.Value).