本文介绍了如何保存“用户控制”数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了多个用户控件,将它们用作页面,每个用户控件页面都进行一些数学运算,并在标签中对结果进行排序。现在我想让用户控制每次关闭程序时保存该标签值。我不知道如何保存它,因为它没有像表格一样的关闭事件。



我尝试过:



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();
       }

推荐答案


这篇关于如何保存“用户控制”数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 14:09
查看更多