Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5983475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:14:11+00:00 2026-05-22T22:14:11+00:00

I have a settings save method I call, but I tried unload, and lost

  • 0

I have a settings save method I call, but I tried unload, and lost focus the application will close out and not save before ever getting to either of those methods. When should I save application settings to keep this from happening?

Should I use a timer and save every 30 seconds, or what?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T22:14:12+00:00Added an answer on May 22, 2026 at 10:14 pm

    How often you save depends on your app. However, the key timings are:

    • Launching
    • Activated
    • Deactivated
    • Closing

    Launching is called when the app is first launched from the main screen and Closing is called when the user presses the back key to exit your app. Naturally, you’ll most likely want to save permanent data in the Closing event.

    Activated is called when the user has closed your app via the Windows button and has gone back into it by pressing the back button. This doesn’t get called if the user launches the app for the first time.

    Likewise, the Deactivated event is called when the user presses the Windows button. Depending on your app, you’ll want to save transient data at this point so that when it’s restored, you can give the illusion that your app wasn’t closed at all. (Otherwise, for example, all textboxes will become empty even if the user entered data before pressing the Windows button).

    Those are the main events, so you can design your app around that. One thing to remember is that if your save files are going to be big, and they take longer than 10 seconds to save after the closing event is called, your app will be terminated immediately, possible corrupting the save file. Therefore, for large saves files, you should plan ahead by saving incrementally (for example, after the user has made a change that should remain permanent).

    There’s no one size fits all solution to this as saving timings are highly dependant on the type of app being developed. Have a read of the Execution Model MSDN Page as it goes into more detail and provides code examples.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a settings file in my Winforms application called Settings.settings with a partial
I have a number of application settings (in user scope) for my custom grid
I have an iPhone application with a settings.bundle that handles various settings for my
For my project I have settings that I added through the Settings in the
I have some settings I need in a Javascript file -- servers to connect
Some projects have properties have miscellaneous settings such as: AllowPayments, ShowSideBar, SectionTitle. Really things
I have a site in rails and want to have site-wide settings. One part
I have some stuff in settings.py that I'd like to be able to access
We have a service that has some settings that are supported only over net.tcp.
I have a web service that needs different settings for different environments (debug, test,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.