can't delete file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Penk

    can't delete file

    I need a form to delete an image that is shown in a control, to replace with
    another image.
    I tried changing the archive that is showing the control, closing the form
    and then deleting the old image, but there's an error
    because the system says that the archive is in use.
    I need to replace this image, someone knows a way to close conections to the
    archive, or something like this?
    Thanks



  • Herfried K. Wagner [MVP]

    #2
    Re: can't delete file

    "Penk" <el_penk@hotmai l.com> schrieb:[color=blue]
    >I need a form to delete an image that is shown in a control, to replace
    >with
    > another image.
    > I tried changing the archive that is showing the control, closing the form
    > and then deleting the old image, but there's an error
    > because the system says that the archive is in use.
    > I need to replace this image, someone knows a way to close conections to
    > the
    > archive, or something like this?[/color]

    \\\
    Dim OriginalImage As New Bitmap("C:\WIND OWS\Angler.bmp" )
    Dim Image As New Bitmap(Original Image)
    OriginalImage.D ispose()
    ..
    ..
    ..
    Image.Dispose()
    ///

    - or -

    \\\
    Dim ImageFile As New FileStream("C:\ WINDOWS\Angler. bmp", FileMode.Open)
    Dim Reader As New BinaryReader(Im ageFile)
    Dim ImageStream As New
    MemoryStream(Re ader.ReadBytes( CInt(ImageFile. Length)))
    Reader.Close()
    Dim Image As Image = Image.FromStrea m(ImageStream)
    ..
    ..
    ..
    Image.Dispose()
    ///

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://classicvb.org/petition/>

    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: can't delete file

      "Penk" <el_penk@hotmai l.com> schrieb:[color=blue]
      >I need a form to delete an image that is shown in a control, to replace
      >with
      > another image.
      > I tried changing the archive that is showing the control, closing the form
      > and then deleting the old image, but there's an error
      > because the system says that the archive is in use.
      > I need to replace this image, someone knows a way to close conections to
      > the
      > archive, or something like this?[/color]

      \\\
      Dim OriginalImage As New Bitmap("C:\WIND OWS\Angler.bmp" )
      Dim Image As New Bitmap(Original Image)
      OriginalImage.D ispose()
      ..
      ..
      ..
      Image.Dispose()
      ///

      - or -

      \\\
      Dim ImageFile As New FileStream("C:\ WINDOWS\Angler. bmp", FileMode.Open)
      Dim Reader As New BinaryReader(Im ageFile)
      Dim ImageStream As New
      MemoryStream(Re ader.ReadBytes( CInt(ImageFile. Length)))
      Reader.Close()
      Dim Image As Image = Image.FromStrea m(ImageStream)
      ..
      ..
      ..
      Image.Dispose()
      ///

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://classicvb.org/petition/>

      Comment

      Working...