private void Form1_Load(object sender, EventArgs e)
{
string path1 = Application.StartupPath.Substring(0,Application.StartupPath.Substring(0,Application.StartupPath.LastIndexOf ("\\")).LastIndexOf ("\\"));
path1 += @"\01.jpg";
string path2 = Application.StartupPath.Substring(0, Application.StartupPath.Substring(0, Application.StartupPath.LastIndexOf("\\")).LastIndexOf("\\"));
path2 += @"\02.jpg";
Image ming = Image.FromFile(path1 ,true );
imageList1.Images.Add(ming);
Image ming2 = Image.FromFile(path2 ,true );
imageList1.Images.Add(ming2);
imageList1.ImageSize = new Size(200,165);
pictureBox1.Width = 200;
}
private void button1_Click(object sender, EventArgs e)
{
pictureBox1.Image=imageList1 .Images [0];
}
这大段程序没怎么弄明白,求大神解答
{
string path1 = Application.StartupPath.Substring(0,Application.StartupPath.Substring(0,Application.StartupPath.LastIndexOf ("\\")).LastIndexOf ("\\"));
path1 += @"\01.jpg";
string path2 = Application.StartupPath.Substring(0, Application.StartupPath.Substring(0, Application.StartupPath.LastIndexOf("\\")).LastIndexOf("\\"));
path2 += @"\02.jpg";
Image ming = Image.FromFile(path1 ,true );
imageList1.Images.Add(ming);
Image ming2 = Image.FromFile(path2 ,true );
imageList1.Images.Add(ming2);
imageList1.ImageSize = new Size(200,165);
pictureBox1.Width = 200;
}
private void button1_Click(object sender, EventArgs e)
{
pictureBox1.Image=imageList1 .Images [0];
}
这大段程序没怎么弄明白,求大神解答

