1)在Form3的后台代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication4
{
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
}
public Form3(string text)
: this()
{
textBox1.Text = text;
}
}
}
2)在Form1中,假设点击button1显示Form3,后台代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form3 f3 = new Form3(textBox3.Text);
f3.Show();
}
}
}
追问亲 不是显示Form 是显示textbox里面的值
追答你运行一下,窗体Form3上的textbox1中显示的内容就是Form1上textBox3的值呀!^_^
