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

Banner Behavior

The Banner Behavior turns a PictureEdit editor into a simplified Image Slider that loops through a collection of images.

The behavior stores banner images that replace the original editor image after a certain delay.

Supported controls

Behavior options

  • Images - a collection of banner images. The behavior iterates through this collection and assigns images to the target editor’s PictureEdit.Image property.
  • Interval - an amount of time (in milliseconds) it takes the editor to switch between images.
  • StartImmediatelly - a boolean property that specifies whether or not the editor should start displaying behavior images right away. If this property is disabled, the editor will start with its own original image.

Code sample

using DevExpress.Utils.Behaviors.Common;

behaviorManager1.Attach<BannerBehavior>(pictureEdit1, behavior => {
    behavior.Properties.StartImmediately = false;
    behavior.Properties.Interval = 3000;
    behavior.Properties.Images = new System.Drawing.Image[] {
        ((System.Drawing.Image)(global::Behaviors.Properties.Resources.SpecialOffer_Image1)),
        ((System.Drawing.Image)(global::Behaviors.Properties.Resources.SpecialOffer_Image2))
    };
});