title: send argument from one winform application to another and populate a textbox
body: <p>I have 2 separate applications with Winforms.  Form1 has a textbox and a button.  When I click the button, I want to pass the textbox.text to my second application as a command line argument, then populate another textbox on Form2.  </p>
  
  <p>I can currently pass the arguments from one application to another just fine, however, I'm not sure how to populate the textbox in my Form2 with the argument from Form1.</p>
  
  <p>Form1:</p>
  
  <pre><code>    private void bMassCopy_Click(object sender, EventArgs e)
      {
          string shortcutName = string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.Programs), "\\", "MassFileCopy", "\\", "MassFileCopy", ".appref-ms");
          Process.Start(shortcutName, " " + tHostname.Text.ToString());
      }
  </code></pre>
  
  <p>Form2:</p>
  
  <pre><code>    [STAThread]
      static void Main(string[] args)
      {
  
          try
          {
              Application.EnableVisualStyles();
              Application.SetCompatibleTextRenderingDefault(false);
              formMain mainForm = new formMain();
              Application.Run(mainForm);
  
              if (args.Length &gt; 0)
              {
                  foreach (string str in args)
                  {
                      mainForm.tWSID.Text = str;
                  }
              }
  
          }
          catch (Exception ex)
          {
              MessageBox.Show(ex.Message);
          }
          finally
          {                
  
  
          }
      }
  </code></pre>
  
  <p>The code above accepts the arguments just fine, however, the application loads and the textbox isn't populated.  A breakpoint seemed to show that the foreach loop doesn't run until after Form2 closes but I can't run the foreach loop prior to Form2 loading because there isn't a textbox to interact with.</p>
  
  <p>Any ideas?</p>