c# pass or sent value one form to another form in .net




This is A C# Practice code:   (Form1)
        using System;
        using System.Collections.Generic;
        using System.ComponentModel;
        using System.Data;
        using System.Drawing;
        using System.Linq;
        using System.Text;
        using System.Windows.Forms;

        namespace database
        {
            public partial class Form5 : Form
            {
                public Form5()
                {
                    InitializeComponent();
                }

                private void button1_Click(object sender, EventArgs e)
                {
                    Form3 ff3 = new Form3(textBox1.Text);
                    ff3.Show();
                }

                private void textBox1_TextChanged(object sender, EventArgs e)
                {

                }
            }
        }


This is A C# Practice code:   (Form 2)

          using System;
          using System.Collections.Generic;
          using System.ComponentModel;
          using System.Data;
          using System.Drawing;
          using System.Linq;
          using System.Text;
          using System.Windows.Forms;

          namespace database
          {
              public partial class Form3 : Form
              {
                  public Form3(string Datas)
                  {
                      InitializeComponent();
                     label1.Text = Datas;
                     DataTable datas = new DataTable();
                     
                      foreach(DataRow ss in datas.Rows)
                      {
                          comboBox1.Items.Add(ss["datas"].ToString());
                      }
                  }

                  private void Form3_Load(object sender, EventArgs e)
                  {
                      
                  }
              }
          }


Video For Result:



Share on Google Plus

About Unknown

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Facebook Comment