Monday, November 5, 2012

SlideShow in C# windows application using picturbox



                           string[] Files;

                              var root = Application.ExecutablePath;

                                var temp = root.Split('\\');
                                temp[temp.Length - 1] = "";
                                temp[temp.Length - 2] = "Images";
                                var newpath = string.Join("\\", temp);
                                Files = Directory.GetFiles(newpath);

/// <summary>
        /// Show the image in the PictureBox.
        /// </summary>
        public static void ShowImage(string path, PictureBox pct)
        {
            pct.ImageLocation = path;
        }

        /// <summary>
        /// Show the next image.
        /// </summary>
        private void ShowNextImage()
        {
            ShowImage(this.Files[(++this.selected) % this.Files.Length], this.pictureBox);
        }

No comments:

Using Authorization with Swagger in ASP.NET Core

 Create Solution like below LoginModel.cs using System.ComponentModel.DataAnnotations; namespace UsingAuthorizationWithSwagger.Models {     ...