Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I made multiple user controls to use them as pages and every user control page does some mathematical operation and sorts result in a label. Now i want to make "user control" save that label value every time i close the program. I don't know how to save it since it doesn't have "closed" event like form does.

What I have tried:

private void Form1_FormClosed(object sender, FormClosedEventArgs e)
       {
           Properties.Settings.Default.label = label1.txt;
           Properties.Settings.Default.Save();
       }
Posted
Updated 16-Aug-18 9:48am
v2

1 solution

Individual controls should not be saving their own data. That should be handled by the form-level or application level code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900