CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2004
    Location
    Toronto, Canada
    Posts
    108

    When's a Good Time to record Size Info in a Form

    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

  2. #2
    Join Date
    Oct 2004
    Location
    Rocket City
    Posts
    220

    Re: When's a Good Time to record Size Info in a Form

    Why would you want to save the current size to a file at any other time than program exit?

  3. #3
    Join Date
    Jun 2005
    Posts
    121

    Re: When's a Good Time to record Size Info in a Form

    Hi. Dispose(bool) is the place you should record your settings, as it is the method called to distroy your form object.

    Bye

  4. #4
    Join Date
    Apr 2004
    Posts
    123

    Re: When's a Good Time to record Size Info in a Form

    Y dont u try it in the Form_Close event...???

    Regards,
    Mmx

  5. #5
    Join Date
    Apr 2004
    Location
    Toronto, Canada
    Posts
    108

    Re: When's a Good Time to record Size Info in a Form

    Thanks, everybody. Its seems to be unanimous that the settings should be recorded when the form is being closed.

    Cheers,
    Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured