void Button1Click(object sender, EventArgs e)
{
//图片异步加载完成后的处理事件
pictureBox1.LoadCompleted += new AsyncCompletedEventHandler(pictureBox1_LoadCompleted);
//图片加载时,显示等待光标
pictureBox1.UseWaitCursor = true;
//采用异步加载方式
pictureBox1.WaitOnLoad = false;
//开始异步加载,图片的地址,请自行更换
pictureBox1.LoadAsync("http://www.zu14.cn/wp-content/uploads/2009/02/image14.png");
}
void pictureBox1_LoadCompleted(object sender, AsyncCompletedEventArgs e)
{
//图片加载完成后,将光标恢复
pictureBox1.UseWaitCursor = false;
}
C#中PictureBox加载网络图片
最新推荐文章于 2024-02-22 14:47:52 发布