form2到form7的数据单向传输

来源:互联网 发布:广州时代微盟网络 编辑:程序博客网 时间:2024/06/06 16:50

 

form2的botton写法: 

private void read_Click(object sender, EventArgs e)
        {
            Form7 formChild = new Form7(this.textBox1Frm2.Text,this.textBox2Frm2.Text,this.textBox3Frm2.Text,this.textBox4Frm2.Text);
            formChild.ShowDialog();

        }

 

form7写法:

    public partial class Form7 : Form
    {
        public Form7(string text,string text2,string text3,string text4)
        {
            InitializeComponent();
            this.textBox1Frm7.Text = text;
            this.textBox2Frm7.Text = text2;
            this.textBox3Frm7.Text = text3;
            this.textBox4Frm7.Text = text4;
        }


        private void button1_Click_1(object sender, EventArgs e)
        {
            this.Close();
        }


    }

原创粉丝点击