public class Form1 : System.Windows.Forms.Form//两个窗体之1
{
static string OPC;//静态变量用来保存
public string xx
{
set{OPC=value;}
get{return OPC;}
}
}
public class Form2 : System.Windows.Forms.Form//两个窗体之2
{
Form1 form1=new Form1();
form1.xx=要传递的值;
}
这个时候当执行了Form2后,Form2的值就保存在Form1中的OPC里。
根据具体问题类型,进行步骤拆解/原因原理分析/内容拓展等。
具体步骤如下:/导致这种情况的原因主要是……