Results 1 to 7 of 7

Thread: load/unload forms

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Posts
    83
    ok i first load a form and have it say lbltest.width = 15, with a timer to increase that every 100 milliseconds

    then i unload it and later load it again, yet when i reload it the lbltest.width is not 15(much much longer in fact)

    why does it do this?
    Ian Callanan
    VB6.0
    [email protected]

  2. #2
    New Member
    Join Date
    Jun 2000
    Posts
    3

    Cool

    well when you unload a form make sure you stop any timers that are on that form, else when you show the form again the code you left executing will still be going

    unload me



    Mike

  3. #3
    Addicted Member LAURENS's Avatar
    Join Date
    Jan 2000
    Location
    Utrecht, the Netherlands
    Posts
    138
    Remember that an unload of a form doesn't destroy the form, hence the code is still in memory. You have to set the form to Nothing after the Unload otherwise the variables, properties etc. , when you do a new load of the form, will still have the values they had at the time of the unload.

    So
    Set frmYourForm = Nothing
    solves your problem.
    Regards,
    Laurens

    Using VB5 Enterprise edition SP3
    VB6 Enterprise edition SP5

  4. #4
    Fanatic Member Wen Lie's Avatar
    Join Date
    Jul 1999
    Location
    Singapore
    Posts
    524

    Wink Yeah,...

    Yeap Iceman,

    I've experienced the same thing like yours. And, I only do 2 things, they are :

    • Set the width in code, not in design !!!
    • Do just exactly like what Laurens told you... Set the form to NOTHING !!!


    I believe, those two steps will help you a lot.

    BRgds,
    Wen Lie
    Regards,
    [-w-]

  5. #5
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    lblTest

    you could just load the lbltest.width into a global variable on unload and reload the lbltest with that value
    in the form activate.
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Posts
    83
    what do you mean by set a form to "NOTHING"? (im relativly new, but learning fast)

    is that some function or do you mean to say to reset all the values i need to 1 by 1

    and 2nd do timers keep running even if i unload the form?
    Ian Callanan
    VB6.0
    [email protected]

  7. #7
    Guest
    When you set it to Nothing, the variables are all destoryed. They do not refer to any object.

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