-
Sorry to be a pain, I know there has been a post on this before, but can't find it.
I heard that the end statement was old and is not the best way to stop your vb app from running. Can anyone tell me what you should use to end your app please?
Many thanks!
-
If what you're talking about is just closing the program, basically you can unload all the active forms or the main MDI form.
-
Click this smily: :rolleyes:
-
a little confused
Thank you Yonatan, that was the one I was looking for.
So which is best...
1) End
2) Call Unload(Me)
3) Set Frm = Nothing
Do these not just do exactly the same thing?
(pardon my ignorance if they are completly different, I have always been told to do the end one).
-
Nope, don't use the end one, use Unload Me.
-
Why End is so bad,everybody's telling not to use End,
WHY??????????
-
Because End simulates the effect of you just pressing the Stop button, which means that if you had any code if Form_Unload, Form_QueryUnload or Form_Terminate then it will not be executed. This would waste memory if you had any class modules initialised but not terminated, and could cause a you GPF if you were Subclassing or Hooking and the call that stops that was in, for example, Form_Unload.
That's why it's bad.
Done.
Ok.
-
I use all of them, but than again, that's just me :rolleyes:.