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:

New beginner's guide to PowerShell on my GitHub page

 I created a beginner's guide to PowerShell here: https://github.com/aamjohns/Powershell_Guide/blob/main/README.md I hope it helps someo...