Y
yoav
Hi Folks,
The following code crashes on the last statement with a "The process
cannot access the file because it is being used by another process"
exception (fiFax is a FileInfo object):
Dim picbox As New PictureBox
picbox.Image = Drawing.Image.FromFile(fiFax.FullName)
picbox.Dispose()
fiFax.MoveTo(fiFax.Directory.FullName & "\Old\" &
fiFax.Name) ' Exception!!!
If I put the "fiFax.MoveTo" statement before the "FromFile" it works.
Why does the picturebox keeps the file locked even after it is
disposed? How can I release it?
TIA
The following code crashes on the last statement with a "The process
cannot access the file because it is being used by another process"
exception (fiFax is a FileInfo object):
Dim picbox As New PictureBox
picbox.Image = Drawing.Image.FromFile(fiFax.FullName)
picbox.Dispose()
fiFax.MoveTo(fiFax.Directory.FullName & "\Old\" &
fiFax.Name) ' Exception!!!
If I put the "fiFax.MoveTo" statement before the "FromFile" it works.
Why does the picturebox keeps the file locked even after it is
disposed? How can I release it?
TIA