Tuesday, June 16, 2009

File displayed in PictureBox control became locked

I came across this issue and found this MS KB document very helpful:

Image file is locked when you set the PictureBox Image property to a file (Article ID: 309482 )

I was displaying an image in a picturebox control and then I was trying to overwrite the file, and display a new image. I could not overwrite the file. I could not rename it or delete it either.

Using a Filestream instead of FromFile resolved the issue.

If you run into this problem check out the MS KB document linked above.

No comments:

Windows 10 with Ubuntu: Install error CanonicalGroupLimited.UbuntuonWindows cannot be found or cannot be accessed

On Windows 10 Enterprise build 1709 I installed the Windows Subsystem for Linux. Next I open the Microsoft Store and did a search for Ub...