Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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