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. C#
  4. unloading the form from memory

unloading the form from memory

Scheduled Pinned Locked Moved C#
performancetutorialquestion
4 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.
  • P Offline
    P Offline
    praveen pandey
    wrote on last edited by
    #1

    hi all, how to unload the form from memory through code? regards, thanks

    D 1 Reply Last reply
    0
    • P praveen pandey

      hi all, how to unload the form from memory through code? regards, thanks

      D Offline
      D Offline
      DaveyM69
      wrote on last edited by
      #2

      Form.Dispose()

      Dave

      P 1 Reply Last reply
      0
      • D DaveyM69

        Form.Dispose()

        Dave

        P Offline
        P Offline
        praveen pandey
        wrote on last edited by
        #3

        I tried this but even after calling form.dispose() the code in form is being executed. I have used a thread and that is a background thread. thanks

        D 1 Reply Last reply
        0
        • P praveen pandey

          I tried this but even after calling form.dispose() the code in form is being executed. I have used a thread and that is a background thread. thanks

          D Offline
          D Offline
          DaveyM69
          wrote on last edited by
          #4

          You may need to abort the thread. Probably the best thing is to have the thread listen for an event that you can raise from your parent thread and use that so it can suspend and or terminate itself cleanly without executing any running code.

          Dave

          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