Click here to Skip to main content
15,174,613 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
How to display images one by one using for loop,without user interface
Posted
Comments
Sandeep Mewara 29-Mar-11 5:26am
   
Not clear. Further, did you try anything?
Sergey Alexandrovich Kryukov 29-Mar-11 11:40am
   
Image show IS the user interface, even if by some reason you don't want it to interface with the user :-)
--SA

Set up a timer, and change the Image property of a PictureBox.

Fields:
private Timer mySlideshow = new Timer();
private int nextSlide = 0;
private Image[] mySlides;
Form load event:
// Load your images into mySlides.
mySlideshow.Interval = 5000;
mySlideshow.Tick += new EventHandler(mySlideshow_Tick);
mySlideshow.Start();
Add:
void mySlideshow_Tick(object sender, EventArgs e)
    {
    if (nextSlide >= mySlides.Length)
        {
        nextSlide = 0;
        }
    myPictureOfSlide.Image = mySlides[nextSlide++];
    }
   
You should study theseA Simple Image Slide Show

Best Regards,
Theingi Win
   
Comments
Sergey Alexandrovich Kryukov 29-Mar-11 11:39am
   
This one is simple and nice. My 5.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900