title: How to pass data of multiple text boxes from one form to another with button clicking?
body: <p>I'm not able to pass data of <strong>multiple text boxes</strong> from <code>Form1</code> to <code>Form2</code> through a button click. I have tried the following way, but it is not working. </p>
  
  <p>Did I do it wrong? And if so, how can I do it?</p>
  
  <p>Form1 Code:</p>
  
  <pre><code>public partial class Form1: Form {
      Form2 frm2;
  
      public Form1() {
          InitializeComponent();
      }
  
      private void btnInvoice_Click_1(object sender, EventArgs e) {
          this.Hide();
  
          if(frm2==null)
              frm2=new Form2();
  
          frm2.ValueFromForm1(txtFirstName.Text);
          frm2.ValueFromForm1(txtLastName.Text);
          frm2.ValueFromForm1(txtCellNo.Text);
          frm2.ValueFromForm1(txtDate.Text);
          frm2.ValueFromForm1(txtDueDate.Text);
  
          frm2.Show();
      }
  }
  </code></pre>
  
  <p>Form2 Code:</p>
  
  <pre><code>public partial class Form2: Form {
      public Form2() {
          InitializeComponent();
      }
  
      public void ValueFromForm1(string value) {
          txtFirstName.Text=value;
          txtLastName.Text=value;
          txtCellNo.Text=value;
          txtMaskDueDate.Text=value;
          txtMaskDate.Text=value;
      }
  }
  </code></pre>