C#(Winfrom)窗体传值问题(子窗体回传值给父窗体)
来源:百度知道 编辑:UC知道 时间:2024/05/26 07:14:50
一楼的朋友 能不能给出具体的代码?本人新手,不吝赐教.谢谢!~
Form1
--------------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Form2ToForm1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 form = new Form2();
form.GetForm(this);
form.Show();
}
}
}
--------------------------------------
Form2
-----------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;