Results 1 to 4 of 4

Thread: unload question..

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2003
    Posts
    62

    unload question..

    halo..i know this is an simple question....but i just confuse.

    in my program...it have several form......

    one of it have a exit button to exit the whole program...

    i code the unload me....but it will unload the form itself..

    but not the whole program..

    izzit i need to unload the startup form?? or any other ways to do so???

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Try...

    VB Code:
    1. Private Sub Form_Unload(Cancel As Integer)
    2. Dim frm As Form
    3.  
    4.     For Each frm In Forms
    5.         Unload frm
    6.         Set frm = Nothing
    7.     Next
    8.  
    9.     End
    10.  
    11. End Sub
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2003
    Posts
    62
    thanks..it works..

    but the forms in the for loop include all those form in my program???

    can clarify me...hehe.

    vbnovice

  4. #4
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344
    VB Code:
    1. Option Explicit
    2. Dim f As Form
    3.  
    4. Private Sub CmdExit_Click()
    5. For Each f In Forms
    6. f.Visible = False
    7. Unload f
    8. App.TaskVisible = False 'This is not needed on most machines.
    9. Next f
    10. End Sub
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width