如何在表单卸载之前获取所有表单控件值? [英] how to get all form controls values before form unloading?

查看:71
本文介绍了如何在表单卸载之前获取所有表单控件值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有两种形式(form1,form2)。

form1包含所有控件,但我没有任何按钮。

在卸载form1之前我必须得到所有form1控件值。



我怎样才能实现它?

Hi,

I have two forms(form1,form2).
form1 contains all controls,but i dont have any button.
before unloading of form1 i have to get all form1 control values.

how can i achieve it?

推荐答案

最好的方法是为整个表单创建一个数据容器类,并使用 BindingSource 将其绑定到控件,这样您需要做的就是在表单退出时获取该类。
The best way is to have a data container class for your entire form and bind that to your controls using BindingSources, that way all you need to do is get that class on your form exit.


这篇关于如何在表单卸载之前获取所有表单控件值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆