十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
namespace _9.图片的上一张和下一张
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
创新互联主要从事网站设计制作、网站制作、网页设计、企业做网站、公司建网站等业务。立足成都服务建湖,10多年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:18982081108
private void Form1_Load(object sender, EventArgs e)
{
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
pictureBox1.Image = Image.FromFile(@"C:\Users\Administrator.USER-20180925HC\Desktop\pic\1.jpg");
}
//获得图片文件夹的全路径
string[] path=Directory.GetFiles(@"C:\Users\Administrator.USER-20180925HC\Desktop\pic");
int i=0;
private void btnDownPic_Click(object sender, EventArgs e)
{
i++;
if (i == path.Length)
{
i = 0;
}
pictureBox1.Image = Image.FromFile(path[i]);
}
private void btnUpPic_Click(object sender, EventArgs e)
{
i--;
if (i < 0)
{
i = path.Length - 1;
}
pictureBox1.Image = Image.FromFile(path[i]);
}
}
}