如何释放picturebox所显示的图片资源
点击按钮删除picturebox上的图片。错误提示为给图片正在使用!请各位老师多多指教
private void button7_Click(object sender, System.EventArgs e)
{
this.pictureBox2.Dispose ();
this.pictureBox2.Image =null;
string pathshow = pathnew+"\\"+"\\"+this.listBox1.SelectedItem.ToString (); //该图片在硬盘上的路径
System.IO.File.Delete(pathshow);
}