Click to See Complete Forum and Search --> : When's a Good Time to record Size Info in a Form


MCRoberts
June 14th, 2005, 01:28 PM
Greetings:
This question is related to a question that I posted a few minutes ago but I am trying to adhere to the one-question-per-post policy.

I am trying to save program settings in an XML file, like directories and the position and size of the main program form. This is working fairly well. However, I am currently using the Resize event as the event where I should update the XML file with the new form size information. Its working OK but it bothers me a bit that this event is called repeatedly as the form is being resized. This means that the XML is being opened, updated and closed 100's of times in a few seconds while the form is being resized.

Is there not an event notification that I can use to tell when the mouse has been dropped and the resize/drag operation is complete and use this as the time to update the form coordinates?

I have read the documentation for the other event SizeChanged and I have even tried it but I cannot see what the difference is between these two events.

Any thoughts?
Thank you in advance,
Mark

zips
June 14th, 2005, 05:05 PM
Why would you want to save the current size to a file at any other time than program exit?

stepi
June 14th, 2005, 06:12 PM
Hi. Dispose(bool) is the place you should record your settings, as it is the method called to distroy your form object.

Bye

mmx_nexus
June 14th, 2005, 11:39 PM
Y dont u try it in the Form_Close event...???

Regards,
Mmx

MCRoberts
June 15th, 2005, 07:52 AM
Thanks, everybody. Its seems to be unanimous that the settings should be recorded when the form is being closed.

Cheers,
Mark