예제 #1
0
 static void slider_GetImage(object sender, DevExpress.XtraEditors.Controls.GetImageEventArgs e)
 {
     if (currentCollection != null)
     {
         if (e.IsStartUp)
         {
             e.Image = currentCollection.Images[0];
             return;
         }
         if (e.IsNext)
         {
             e.Image = currentCollection.Images[currentImageIndex + 1];
             if (e.CurrentImageUpdated)
             {
                 ++currentImageIndex;
             }
         }
         else if (e.IsPrev)
         {
             e.Image = currentCollection.Images[currentImageIndex - 1];
             if (e.CurrentImageUpdated)
             {
                 --currentImageIndex;
             }
         }
     }
 }
 private void imageSlider1_GetImage(object sender, DevExpress.XtraEditors.Controls.GetImageEventArgs e)
 {
     if (e.IsStartUp)
     {
         e.Image = images[0];
         return;
     }
     if (e.IsNext)
     {
         e.Image = images[currentImageIndex + 1];
         if (e.CurrentImageUpdated)
         {
             ++currentImageIndex;
         }
     }
     else if (e.IsPrev)
     {
         e.Image = images[currentImageIndex - 1];
         if (e.CurrentImageUpdated)
         {
             --currentImageIndex;
         }
     }
 }