WinForm跨窗体传值

1、另一窗体建公共变量listdataRow 

 public List<DataGridViewRow> listdataRow = new List<DataGridViewRow>();

 FRM_TR_CurrencyQueryEx_View2_DLCR frmTrCurrencyQueryEx = new FRM_TR_CurrencyQueryEx_View2_DLCR(cbx_selectType.Text);
            frmTrCurrencyQueryEx.ShowDialog();
            if (frmTrCurrencyQueryEx.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                listdataRow = frmTrCurrencyQueryEx.listdataRow;
                GetInfoManagerName();


            }
View Code

2、通过构造函数

public Form2 ( int value1 , string value2 )
{
    InitializeComponent ( );
    this.value1 = value1;
    this.value2 = value2;
}
View Code

3、其它方法

参考如下博友

http://www.cnblogs.com/xiaofengfeng/p/3182056.html

 
posted @ 2016-05-25 16:18  Mark1997  阅读(610)  评论(0编辑  收藏  举报