桌面开发C# imageList问题+timer

来源:百度知道 编辑:UC知道 时间:2024/05/15 08:58:16
比如我现在有5张图片在imageList里面存好了
显示在pictureBox里面是 pictureBox1.Image = imageList1.Images[0];
只能显示一张。我想做5张照片通过timer定时器,循环显示。
求代码。

新建一个工程文件,命名不妨为Test,在窗体中添加控件PictureBox、ImageList和Timer。然后在vs2005里的主窗体里编写代码如下,即可实现你的功能:

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

namespace Test

{

    public partial class Form1 : Form

    {

        int index = 0;

        public Form1()

        {

            InitializeComponent();

        }

        private void Form1_Load(object sender, EventArgs e)

&nb