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. Closing form and form childs crisis!

Closing form and form childs crisis!

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

    Hi! I have a main form that handles several other child forms.The thing is that when i close the main form, and i want to close all of the child forms, it seems that the Main thread doesn't wait for the child forms to terminate.The main form calls Dispose() which destroys the mainUI first than the childs. Is this the correct procedure or do i have to destroy first the child forms and only then the mainUI? Thanks in advance. Never say never

    G 1 Reply Last reply
    0
    • C carlos_rocha

      Hi! I have a main form that handles several other child forms.The thing is that when i close the main form, and i want to close all of the child forms, it seems that the Main thread doesn't wait for the child forms to terminate.The main form calls Dispose() which destroys the mainUI first than the childs. Is this the correct procedure or do i have to destroy first the child forms and only then the mainUI? Thanks in advance. Never say never

      G Offline
      G Offline
      GuruPandian
      wrote on last edited by
      #2

      Hi, - If the Form1 is a MainForm then (Form1 -> Property -> isMdiContainer=True) - I hope the below code will help U Private Sub CallForm2(...) Handles MenuItem2.Click Dim F2 As New Form2() F2.MdiParent = Me F2.Show() End Sub Private Sub CallForm3(...) Handles MenuItem3.Click Dim F3 As New Form3() F3.MdiParent = Me F3.Show() End Sub Private Sub CallExit(...) Handles MenuItem4.Click Application.ExitThread() End Sub With Regards PANDIAN S:)

      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