实际上我有 3 种形式,和一个类,我在其中定义了列表的 class(ReadXMLToEcasWindow)
public List<string> ack_line_path = new List<string>();
从button_click 上的表单 1将弹出form2 ,在 form2 内,我将值添加到函数下的 List
private void add_path_after_successful_load()
{
int rowcount = Ecas_config_gridview.Rows.Count;
for (int i = 0; i < rowcount; i++)
{
XML_To_Ecas.ack_line_path.Add(Ecas_config_gridview.Rows[i].Cells[3].Value.ToString());
}
this.Hide();
}
//once the values got added form2 will be hidden, again **clicking on form1 button** , form3 under which i want to use these list values
private void btn_ECAS_Click(object sender, EventArgs e)
{
ECAS_WINDOW_FORM F_Ecas= new ECAS_WINDOW_FORM(this);
F_Ecas.Show();
}