C#.Net Winforms(传递数据) [英] C#.Net Winforms (passing data)

查看:66
本文介绍了C#.Net Winforms(传递数据)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MainForm和其他子窗体.
在子形式1中,我在ComboBox中选择一个值.
现在关闭表格1并注销主表格.
我再次登录并输入子表格2,
如何从1st(form-1)到2nd(form-2)中获取所选ComboBox值的值

I have a MainForm and to other child forms.
In child form-1 i select a value in ComboBox.
Now to close the form-1 and logout of main form.
Again i login and enter the child form-2 ,
How to get value of selected ComboBox value from 1st(form-1) to 2nd(form-2)

推荐答案

如果Form2是Form1的子代,则不需要要注销并重新登录到应用程序,只需将ComboBox值从一个Form1传递给Form2,然后再传递给Form1.

这些链接可帮助您将值从一种形式传递给另一种形式.
send-values-from-一种形式到另一种形式的c-sharp-winforms [使用委托在两种形式之间传递数据 [ ^ ]
在表单之间传递数据 [
If the Form2 is the child of Form1 than no need to logout and re login to the application just pass the ComboBox value form one Form1 to Form2 and hind the Form1.

These link help you do pass value from one form to another.
send-values-from-one-form-to-another-form-in-c-sharp-winforms[^]
Using a delegate to pass data between two forms[^]
Passing Data Between Forms[^]


这篇关于C#.Net Winforms(传递数据)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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