Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. System.IO.IOException (Picturebox)

System.IO.IOException (Picturebox)

Scheduled Pinned Locked Moved Visual Basic
helpcsharpwinforms
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LeeOvEngland
    wrote on last edited by
    #1

    I have an winforms application that lets a user click on a listbox which holds a list of images. When the user clicks on a list item the corresponding image is loaded into the picturebox using the picturebox.image.fromfile(CStr(lstBox.SelectedItem)) syntax. The user is able to click a delete button which should delete the currently viewable picturebox image. Before doing the delete I am calling the following methods: picturebox.Image.Dispose() picturebox.Image = Nothing picturebox.Image.fromFile("temp.gif") so that the image i want to delete is freed from system resources. I keep getting the following error "The process cannot access the file "image.jpg" because it is being used by another process" I have tried numerous things to get round this error. My code does not load any images anywhere else apart from the picturebox. Please can anyone help!

    Richard DeemingR 1 Reply Last reply
    0
    • L LeeOvEngland

      I have an winforms application that lets a user click on a listbox which holds a list of images. When the user clicks on a list item the corresponding image is loaded into the picturebox using the picturebox.image.fromfile(CStr(lstBox.SelectedItem)) syntax. The user is able to click a delete button which should delete the currently viewable picturebox image. Before doing the delete I am calling the following methods: picturebox.Image.Dispose() picturebox.Image = Nothing picturebox.Image.fromFile("temp.gif") so that the image i want to delete is freed from system resources. I keep getting the following error "The process cannot access the file "image.jpg" because it is being used by another process" I have tried numerous things to get round this error. My code does not load any images anywhere else apart from the picturebox. Please can anyone help!

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      This is a documented bug in the framework: VB.NET: http://support.microsoft.com/kb/309482[^] C#: http://support.microsoft.com/kb/311754[^]


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups