比如说是Form1调用form2 在form2中的label显示form1中的textbox1中输入的内容则
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 mform2 = new Form2(textBox1.Text);
mform2.Show();
}
}
}namespace WindowsApplication1
{
public partial class Form2 : Form
{
string s;
public Form2()
{
InitializeComponent();
}
public Form2(string ss1)
{
InitializeComponent();
s = ss1;
}
private void f2_Load(object sender, EventArgs e)
{
label1.Text = s;
}
}
}