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. Renaming a file

Renaming a file

Scheduled Pinned Locked Moved Visual Basic
help
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.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    Hi, I have got a picturebox that displays an image in correspondance with the node selected in a treeview. What i want to do is when a node is renamed for the file that the picturebox is pointing to to also be renamed. The problem i get is the filenotfound exception from the rename. I am pretty sure tho not 100% that this is because the image file is being displayed in the picturebox at the same time that i am trying to rename the file. I have tried makign the picturebox empty as well as trying to use image.dispose() but i cannot seem to get it to work. Help would be VERY appreciated thanks Dean

    H 1 Reply Last reply
    0
    • A Anonymous

      Hi, I have got a picturebox that displays an image in correspondance with the node selected in a treeview. What i want to do is when a node is renamed for the file that the picturebox is pointing to to also be renamed. The problem i get is the filenotfound exception from the rename. I am pretty sure tho not 100% that this is because the image file is being displayed in the picturebox at the same time that i am trying to rename the file. I have tried makign the picturebox empty as well as trying to use image.dispose() but i cannot seem to get it to work. Help would be VERY appreciated thanks Dean

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      A PictureBox stores the image at that time and is not tied to the image. For instance, if you changed the image (added a line or something), the changes are not reflected automatically in the PictureBox. This requires change notification. More than likely, you're not giving a fully resolvable path to the file, which is either a fully-qualified path or a relative path to the current working directory (not necessarily always the directory from which your app is running). The best thing you can do is debug your code using the excellent tools in the IDE. Debugging code is half the battle.

      -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

      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