111,125
社区成员
发帖
与我相关
我的任务
分享
private void button1_Click(object sender, EventArgs e)
{
Form10 form = new Form10();
form.testValue = this.textBox1.Text;
form.ShowDialog();
}
窗体1中的代码。窗体1中就放了个文本框和一个按钮
public Form10()
{
InitializeComponent();
}
public string testValue { get; set; }
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
private void Form10_Load(object sender, EventArgs e)
{
this.textBox1.Text = testValue;
}
Form2 f2 = New Form2();
f2.Text = Textbox1.Text.Trim(); Form2窗体名称显示为Form1窗体中的Textbox1输入的值