两窗体间传值

FORM2:

public FORM2(string btnValue, string userNumber)

{

InitializeComponent();

this.btnUIEOk.Text = btnValue;

this.txtUIENumber.Text = userNumber;

}

FORM1:

string btnValue = this.btnUMAdd.text;

string userNumber = this.dgvUser.SelectedCells[1].Value.ToString();

FORM2 f2=new FORM2(btnvalue, userNumber)

f2.show();

通过newFORM2实例,把两个值传给他, 然后在FORM2中可以引用

posted @ 2012-07-02 14:10  zhcnblog  阅读(107)  评论(0编辑  收藏  举报