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. Other Discussions
  3. IT & Infrastructure
  4. C# Windows Forms program freezes on form unload

C# Windows Forms program freezes on form unload

Scheduled Pinned Locked Moved IT & Infrastructure
csharpwinformsquestion
3 Posts 3 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.
  • J Offline
    J Offline
    John Mautari
    wrote on last edited by
    #1

    Hi, I'm having trouble with C# and windows forms. When I finish the form (using the windows' close button or the form close button), sometimes the program's window get closed but the program never stops (the program executable is still visible in the task list). Did I missing something?

    R J 2 Replies Last reply
    0
    • J John Mautari

      Hi, I'm having trouble with C# and windows forms. When I finish the form (using the windows' close button or the form close button), sometimes the program's window get closed but the program never stops (the program executable is still visible in the task list). Did I missing something?

      R Offline
      R Offline
      Rama Krishna Vavilala
      wrote on last edited by
      #2

      How does the code for your main function looks like. If you are not using code like Application.Run(new Form1()); you need to handle FormClosed event and call Application.Exit

      1 Reply Last reply
      0
      • J John Mautari

        Hi, I'm having trouble with C# and windows forms. When I finish the form (using the windows' close button or the form close button), sometimes the program's window get closed but the program never stops (the program executable is still visible in the task list). Did I missing something?

        J Offline
        J Offline
        James T Johnson
        wrote on last edited by
        #3

        If you create any threads which can safely be disposed of when the program exits, set the IsBackground property on it to true. James

        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