🙂 İNSANLARIN EN HAYIRLISI INSANLARA FAYDALI OLANDIR 🙂

Burak HABER / C# / 63. Formlar Arası Veri Taşıma

1-) C# - 63. Formlar Arası Veri Taşıma

Form1.cs

using System;

using System.Windows.Forms;

 

namespace _63.FormlarArasiVeriTasima

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

 

        private void button1_Click(object sender, EventArgs e)

        {

            Form2 frm = new Form2();

            frm.mesaj = textBox2.Text;

            frm.kimden = textBox1.Text;

            frm.Show();

            this.Hide();

        }

    }

}

Form2.cs(project add form)

using System;

using System.Windows.Forms;

 

namespace _63.FormlarArasiVeriTasima

{

    public partial class Form2 : Form

    {

        public Form2()

        {

            InitializeComponent();

        }

        public string mesaj;

        public string kimden;

        private void Form2_Load(object sender, EventArgs e)

        {

            label1.Text = kimden;

            label2.Text = mesaj;

        }

    }

}



Form1.cs[desing]



Form2.cs[desing]

 2021 Mart 11 Perşembe
 454