|
-
Jul 12th, 2007, 11:17 PM
#1
Thread Starter
Lively Member
[RESOLVED] [02/03] Saving data on close/terminate.
I want to call a function that saves data to a text file when my app is closed or terminated. How do I do this?
Please note I am using 2002 version.
Thanks.
-
Jul 13th, 2007, 12:32 AM
#2
Re: [02/03] Saving data on close/terminate.
Handle the Closed event of your main form and save the data in the event handler.
-
Jul 13th, 2007, 12:37 AM
#3
Thread Starter
Lively Member
Re: [02/03] Saving data on close/terminate.
 Originally Posted by jmcilhinney
Handle the Closed event of your main form and save the data in the event handler.
sorry but im a bit of a newbie... how do i do that?
-
Jul 13th, 2007, 12:50 AM
#4
Re: [02/03] Saving data on close/terminate.
To create an event handler you open the code window, select the object from the drop-down list at the top left and the event you want to handle from the drop-down list at the top right. To write text to a file you use a StreamReader object.
-
Jul 13th, 2007, 01:00 AM
#5
Thread Starter
Lively Member
Re: [02/03] Saving data on close/terminate.
 Originally Posted by jmcilhinney
To create an event handler you open the code window, select the object from the drop-down list at the top left and the event you want to handle from the drop-down list at the top right. To write text to a file you use a StreamReader object.
I know how to save the data. In the drop down their is a finalize event - is that the one where I should add my code before the MyBase.Finalize()?
Thanks.
-
Jul 13th, 2007, 01:12 AM
#6
Re: [02/03] Saving data on close/terminate.
Finalize is not an event. It's a method. You should absolutely NOT be saving settings in the Finalize method. I've already said that you should be doing it in the Closed event handler.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|