CLOSE or DISPOSE?

  • 18 years ago

    in my EXIT button on a form..
    should I say
    me.close,me.dispose,me.finalize OR Me = nothing???????

  • 18 years ago

    Code:
    Unload Me

  • 18 years ago

    ... and then to free up any resources used up by the form do this:


    Set <form name> = Nothing


    Good Luck!

  • 18 years ago

    Unload Me is not valid in .Net. Me.Close is fine as in .Net it clears the reference to the form and setting it to nothing is uneccessary. If you really want to set it to nothing then you don't need the 'Set' keyword anymore. It's gone in .Net all you need to do is formname = nothing.

  • 18 years ago

    craaaaaap! I'm thinking pre.net here... i should learn to be more attentive.


    yes as the talented musician said .NET there is no need for set just do <form name> = Nothing


    Thanks Musician and sorry about that.

  • 18 years ago

    Hehe we're all learning this stuff at the moment.

  • 18 years ago

    true.


    What do you persnoally  think about .NET? I've been working with it since the public beta 1 and learning C# and VB.NET as well as ASP.NET but I am no way a pro yet. The runtimes are a little hassle still and i guess its gonna take a while before 'real' applications get out in the open.

  • 18 years ago

    oh crap... I didn't notice that this was a .net thread...


  • 18 years ago

    yeah dont worry! we all make mistakes.

  • 18 years ago

    Yeah I'm still learning this new beast but I'm now using it full time since I persuaded my employer to order it. I'm currently working on an enhanced notepad that will compile .net scripts. This is just so I can learn as I go since I have VS.Net at work but I'm very happy overall with it.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Java is to JavaScript what Car is to Carpet.” - Chris Heilmann