Saving form position.

  • Thread starter Thread starter Marty
  • Start date Start date
M

Marty

Hi,

I want to save the form position when the user close it. I tried to
place the coordinate saving code in my destructor, but it is not
triggered when I assign the form to null.

Where should I place my code to save the coord. when the form close?

Thanks
Marty
 
Hi,


What about using Closing event ?

Where are you saving this info into?

cheers,
 
..NET depends on garbage collector to destroy objects. Only when GC
decides to destroy the object that the destructor is called. That's why
you don't see your destructor being called immediately.

For what you need, you can either put the code in the Closed event or
in the Dispose method of the form.

Suriyanto
 
Thank you Suriyanto,
I finally used the OnClosing() event and it work.
Have a nice day!
Marty
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top