从一个WINFORM 向另一个 WINFORM 传参数 你是怎么做的?

解决方案 »

  1.   

    在第二个窗口中,设置相关属性,用于传递你的信息class From1:From
    {
    button1_Click()
    {
      From2 from2 = new From2();
    // 设置第二个窗口的信息
      from2.SomeText = "abc";
      from2.SomeValue = 123;
      from2.Show();
    }
    }class From1:From
    {
      public string SomeText
    {
    get...
    set...
    }
      public string SomeValue
    {
    get...
    set...
    }
      from2_load()
    {
    // 窗口显示时,根据指定的参数显示
      lable1.Text = this.SomeText;
      lable2.Text = this.SomeValue.ToString();
      ...
    }
    }
    }
      

  2.   

    http://www.zahui.com/html/14/34025.htmVisual C#中实现窗体间的数据传递或许对你有些帮助
      

  3.   

    http://msdn2.microsoft.com/library/ms171925(en-US,VS.80).aspx