做个第三方类,在弹出窗口时实例化这个类,将table传到其中,在原窗口中通过属性得到实例中的table值

解决方案 »

  1.   

    在主窗口中定义一个public static 的table,然后在弹出的窗口中对它进行赋值就好啦:
    如下:
    主窗口:Form1;
    public static DataTable dt;
    弹出窗口:
    private void button1_Click(object sender, System.EventArgs e)
    {
    Form1.m = "llll";
    }
      

  2.   

    重载ShowDialogpublic System.Windows.Forms.DialogResult ShowDialog(System.Windows.Forms.Form owner, out object objOut)
    {
    System.Windows.Forms.DialogResult result;
    if (owner==null) 
    {
    result = base.ShowDialog();
    }
    else
    {
    result = base.ShowDialog(owner);
    }
    objOut = 你的DataTable
    this.Dispose(true);
    return result;
    }
      

  3.   

    it could be realized by using "Session",but the question lies on "by what" get return;using "javascript" or "overload the dialog",i don't know!pls expers share your points!
      

  4.   

    http://xml.sz.luohuedu.net/xml/ShowDetail.asp?id=49ML4AO8-5PB3-4KNY-NJZD-LJOIOXV4M1X4
      

  5.   

    using "javascript" 在子webform关闭时传给父窗体