很容易! 首先你不能达到其他形式在C#在vb.net不正常的方式来控制,这样你就可以做到以下几点:
1 - 在窗体构造函数中void add参数来处理接收到的数据。
2-在InitializeComponent();之后;空添加的代码行,象下面这样:
public frm1(string txt1, string txt2, string txt3)
{
InitializeComponent();
textBox1.Text = txt1;
textBox2.Text = txt2;
textBox3.Text = txt3;
}
1-创建变量来保存发送的数据。
2-为将处理数据的表单创建一个新的表单实例,并按照确切的顺序将行单元格数据传递给方法参数。
private void dg_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
{
//Collect the row cells values:
string val1 = dg.Rows[e.RowIndex].Cells[0].Value.ToString() //data of the first cell in the row
string val2 = dg.Rows[e.RowIndex].Cells[1].Value.ToString() //data of the second cell in the row
string val3 = dg.Rows[e.RowIndex].Cells[2].Value.ToString() //data of the third cell in the row
//Initialize a new instance of the data handle form and send the row data to it:
var newFrm = new frm1(val1, val2, val3);
newFrm.Show();
}
依此类推,您可以创建尽可能多的参数。
我不知道你到目前为止有什么代码,但你不能创建一个新的窗体的构造函数,它将dataGridView中的所需数据作为参数,并在双击事件中使用该构造函数创建窗体? – spersson
[将值从一个窗体发送到另一个窗体]可能的重复(http://stackoverflow.com/questions/1559770/send-values-from-one-form-to-another-form) – stuartd