C#各个窗体之间如何传值啊!

1、你自定义窗体时为窗体增加相应的属性,比如:
class MyForm:Form{
....
private string something;
public string Something{get{return something;}set{something=value;}}
}
通过类似这种属性来传值:form1.Something=xxx

2、另一种是建立一个中间件来存储数据,比如建立一个Record类:
class Record搜索{
public static string Something;
}
二个窗体互传值时通过Record.Something来设置和调用值:
比如在form1中调用 Record.Something="something"来设置要传的值,在form2中调用
xxx=Record.Something 来接收传来的值

原文地址:https://www.cnblogs.com/FLWL/p/3963742.html