如何通过按钮在图像控件中显示一系列图像(下一个) [英] How to display a series of images in a image control by a Button(Next)

查看:85
本文介绍了如何通过按钮在图像控件中显示一系列图像(下一个)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
我需要在图像控件中连续显示一些图像说20-30 图像,方法是单击 下一步 按钮..并且还以按钮(上一个)以相同顺序返回如何实现此目的..

hi I need to show some images say 20-30 images continuously in a series in a image control by clicking Next button.. and also go back in the same order with a button(previous) how can i achieve this ..

推荐答案

使用imagelist>选择图像添加图片点击确定

设置图片大小200X200



下一个带加载表格的按钮代码是



use imagelist > choose images to add images click ok
set image size 200X200

Next button code with loading form is

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace EgApp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }


        private void Form1_Load(object sender, EventArgs e)
        {
            Img_idx = 0;
            pictureBox1.Image = imageList1.Images[Img_idx];
        }

        static int Img_idx;
        private void button2_Click(object sender, EventArgs e)
        {
            if (Img_idx < imageList1.Images.Count)
            {
                pictureBox1.Image = imageList1.Images[++Img_idx];
            }
        }


    }
}


这篇关于如何通过按钮在图像控件中显示一系列图像(下一个)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆