Form2

public partial class Form2 : Form
{
    public string str;
    public Form2()
    {
        InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
        str = textBox1.Text;
        Form3 f3 = new Form3();
        f3.ShowDialog(this);
    }
}

Form3

public partial class Form3 : Form
{
    public Form3()
    {
        InitializeComponent();
    }

    private void Form3_Load(object sender, EventArgs e)
    {
        Form2 f2 = (Form2)this.Owner;
        MessageBox.Show(f2.str);
    }
}

 

或者直接把Form1中的textBox的属性设为Public

相关文章:

  • 2021-07-07
  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-05
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
  • 2022-01-08
相关资源
相似解决方案