Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21243

Unload Me

$
0
0
Hi VB friends,
I am a bit confused whenever I use the Unload event...That is because each time we have to unload the form and to release the reference to the form.
My issue is I don't understand very well which is the correct sequence of this process : should I set to nothing the form as a first line of code or simply to unload the form and after that to set it as nothing ? For example I have a second form which I want to unload it properly :
Code:

Private Sub Form_Unload(Cancel As Integer)
        Unload Me
        Set Form2 = Nothing
End Sub

Is this sequence correct or it doesn't matter any order ? On the other hand, the Me argument couldn't be replaced with Form2 (... Unload Form2) ?
Thank you in advance.

Viewing all articles
Browse latest Browse all 21243

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>