title: Get value returned from another Window WinForms C#
body: <p>I have a grid in which the user can select rows and change the date of a row.<br>
  My problem is is that I can't figure out how to pass the value between the windows.<br>
  My first window (form1) has the grid and my second window (form2) is where I pick the date:</p>
  
  <p><a href="https://i.stack.imgur.com/XZUzS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XZUzS.png" alt="enter image description here"></a></p>
  
  <p>In the case above, the date of the selected date should be changed. </p>
  
  <p>I have all the information to do the update but the only thing I'm having trouble with is passing the selected date from the second window back to the first one. </p>
  
  <p>My approach is: </p>
  
  <p>Form1:</p>
  
  <pre><code>private void btn_LaunchChangeInvoiceDate_ItemClick(object sender, ItemClickEventArgs e)
  {
      DateTime UpdatedDate;
      if(gridView.SelectedRowsCount &gt; 0 )
      {
          Form2 DatePicker = new Form2();
          DatePicker.Show();
          UpdatedDate = DateTime.Parse(DatePicker.SelectedDate);
      }
  }
  </code></pre>
  
  <p>Form2:</p>
  
  <pre><code> public String SelectedDate;
  
      public MonthPicker()
      {
          InitializeComponent();
      }
  
      private void btn_PickDate_Click(object sender, EventArgs e)
      {
          SelectedDate = dateTimePicker1.Value.ToString("yyyy-MM-dd");           
      }
  }
  </code></pre>
  
  <p>What would my method be to push <code>SelectedDate</code> to <code>Form1</code>?<br>
  My current app just gets stuck without much information...</p>