- c#: 将form1的textbox中的值传给form2的textbox中
- form1:
- {
- private void button1_Click(object sender, EventArgs e)
- {
- Form2 fr2 = new Form2(this.textBox1.Text);
- this.Hide();
- fr2.Open();
- }
- }
- form2:
- {
- public Form2(string txtname)
- {
- this.textBox1.Text = txtname;
- InitializeComponent();
- }
- }
- Asp.Net中 Session 传值
- form1
- {
- Session["UserName"] = this.textbox1.text;
- }
- form2
- {
- string username = Session["UserName"].Tostring();
- this.textbox1.text = username;
- }
窗口间的传值
最新推荐文章于 2024-09-20 07:32:46 发布