内存不足的问题
数据库字段绑定到textbox控件,PictureBox控件显示textbox为路径的图片,导航条显示前后移动N条记录后,显示错误“内存不足”,怎么解决?
程序代码:
Private Sub TextBox23_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox23.TextChanged PictureBox2.Image = Nothing If TextBox23.Text <> Nothing Then If Not ((TextBox23.Text)) Then MessageBox.Show("找不到文件;" & TextBox23.Text) TextBox23.Text = "d:\数据库\空白文件.jpg" End If PictureBox2.Image = Image.FromFile(TextBox23.Text) Else PictureBox2.Image = Nothing End If End Sub数据库记录移动到大约100个记录以后就出现错误,停到这一行
PictureBox2.Image = Image.FromFile(TextBox23.Text)