if ( pictureBox1.Image == imageList1.Images[0] ) 这样写对吗
展开全部
private void button1_Click(object sender, EventArgs e)
{
imageList1.Images.Clear();
string path = "1.jpg";
Image img = Image.FromFile(path,true);
imageList1.Images.Add(img);
imageList1.ImageSize=new Size(215,135);
pictureBox1.Image=imageList1.Images[0]; //注意这里的索引
}
private void button2_Click(object sender, EventArgs e)
{
imageList1.Images.Clear();
string Path = "2.jpg";
Image img = Image.FromFile(Path, true);
imageList1.Images.Add(img);
imageList1.ImageSize = new Size(215,135);
pictureBox1.Image = imageList1.Images[0];//注意这里的索引
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询