|
-
Jun 18th, 2000, 12:44 PM
#1
Thread Starter
Lively Member
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?
-
Jun 18th, 2000, 01:03 PM
#2
New Member
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
-
Jun 18th, 2000, 01:50 PM
#3
Addicted Member
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
-
Jun 18th, 2000, 06:08 PM
#4
Fanatic Member
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
-
Jun 18th, 2000, 06:40 PM
#5
_______
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
-
Jun 19th, 2000, 03:33 AM
#6
Thread Starter
Lively Member
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?
-
Jun 19th, 2000, 03:41 AM
#7
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|