110,567
社区成员
发帖
与我相关
我的任务
分享
public System.Windows.Forms.TextBox textBox1;//在Form2.Designer.cs中。
private void button1_Click(object sender, EventArgs e)
{
Form2 form2 = new Form2();
form2.textBox1.Text = textBox1.Text;
form2.Show();
}
private void button1_Click(object sender, System.EventArgs e)
{
Form2 f2 = new Form2();
f2.Value = this.textBox1.Text.Trim();
f2.Show();
}
private string strValue;
public string Value
{
get { return strValue; }
set { strValue = value; }
}
//窗体的Load事件
private void Form2_Load(object sender, System.EventArgs e)
{
this.textBox1.Text = Value;
}