C#中PictureBox异步加载图片 – 性别男、爱好女 – 博客频道 – CSDN.NET 蛮不错的异步加载图片的demo private void button1_Click(object sender, EventArgs e)</p><p> {</p><p> //模拟</p><p> String[] st=new String[13];</p><p> for (int i = 0; i < 13; i++)</p><p> {</p><p>//这里我用的是比较大的图片 桌面背景 用于测试 可以根据自己的实际情况来添加地址 可以是url等形式</p><p> st[i]=@”D:/备份/桌面背景/”+i+”.jpg”; </p><p> }</p><p>//为了节约时间 简洁代码 创建图片容器时没多做处理</p><p> for (int j = 0; j < st.Length; j++)</p><p> { //创建pictureBox</p><p> PictureBox pi = new PictureBox();</p><p> pi.InitialImage = global::MainForm.Properties.Resources._36_1_;//等待时显示其他图片</p><p> pi.Location = new System.Drawing.Point(22, 25);</p><p> pi.Name = “pictureBox” + j;</p><p> pi.Size = new System.Drawing.Size(185, 99);</p><p> pi.TabIndex = 0;</p><p> pi.TabStop = false;</p><p> pi.LoadCompleted += new System.ComponentModel.AsyncCompletedEventHandler(this.pictureBox1_LoadCompleted);</p><p> //图片异步加载完成后的处理事件</p><p> pi.LoadCompleted += new AsyncCompletedEventHandler(pictureBox_LoadCompleted);</p><p> //图片加载时,显示等待光标</p><p> pi.UseWaitCursor = true;</p><p> //采用异步加载方式</p><p> pi.WaitOnLoad = false;</p><p> //开始异步加载</p><p> pi.LoadAsync(st[j].ToString());</p><p> flowLayoutPanel1.Controls.Add(pi);</p><p> }</p><p><br /></p><p> }</p><p>//通用事件</p><p> private void pictureBox_LoadCompleted(object sender, AsyncCompletedEventArgs e)</p><p> {</p><p>//转换成PictureBox </p><p> PictureBox pi = (PictureBox)sender;</p><p> //图片加载完成后,将光标恢复</p><p> pi.UseWaitCursor = false;</p><p> } 来源URL:http://cache.baiducontent.com/c?m=9f65cb4a8c8507ed4fece7631046893b4c4380146d96864968d4e414c42246040239e5b927261702d3cf7c7a52ef0f07bbae616f615466e4c096c957d9bb9023248e27203541c6171d820eafca5125b037e65afed868f0caf025e3d8c5d2af4323bb44737b97868d4d761edd6e80034095b1ed42022e10ad9a3572fe296058e93430c75088e4251d76&p=9f62c316d9c109f308e2947d0e0081&newp=9264c815d9c342ac40a9c7710f4bc4231610db2151dcd30d3b&user=baidu&fm=sc&query=c%23+%D2%EC%B2%BD%BC%D3%D4%D8%CD%F8%C2%E7%CD%BC%C6%AC&qid=ee64d468013e3dec&p1=5