title: How to pass value between two forms
body: <p>So I have two forms, and i want to pass a string value from opened form (Form2) to the main form (Form1)</p>
  
  <hr>
  
  <p>The case is:</p>
  
  <p>Show Form2 with a button in Form1, then Form2 shows a process list in a listbox. I want to pass the process name (string, with slctItm variable) from Form2 into a textBox in Form1 with a button in Form2. Please help me.</p>
  
  <p>Code (form2):</p>
  
  <pre><code>...
  public Form2()
      {
          InitializeComponent();
      }
  
      private void Form2_Load(object sender, EventArgs e)
      {
          Process[] prc = Process.GetProcesses();
          foreach ( Process aPrc in prc)
          {
              listBox1.Items.Add(aPrc.ProcessName);
          }
      }
  
      private void button1_Click(object sender, EventArgs e)
      {
          string slctItm;
          slctItm= listBox1.GetItemText(listBox1.SelectedItem);
          //how to pass this value?
      } 
  ...
  </code></pre>
  
  <p>thanks</p>