title: How do I use Form.ShowDialog?
body: <pre><code>private void button2_Click(object sender, EventArgs e)
          {
              ChangeLink cl = new ChangeLink();
              // Show testDialog as a modal dialog and determine if DialogResult = OK.
              if (cl.ShowDialog() == DialogResult.OK)
              {
                  // Read the contents of testDialog's TextBox. 
                 // cl.AcceptButton.DialogResult = DialogResult.OK;
                  this.label4.Text = cl.textBox1Text;
              }
              else
              {
                  this.label4.Text = &quot;Cancelled&quot;;
              }
              cl.Dispose();
  
          }
  </code></pre>
  <p>When I click the button, I see the new Form and the textBox1 in the new Form. And I can type in the textBox1 something, but I can't see anywhere an OK or CANCEL buttons. Should I add them manualy in the new Form designer? And how to use them then?</p>
  <p>This is the code in my new Form what I wanted to do is to type something in the new Form textBox1 and pass the text in the textBox1 to Form1 label4.</p>
  <pre><code>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 GatherLinks
  {
      public partial class ChangeLink : Form
      {
          public ChangeLink()
          {
              InitializeComponent();
  
  
          }
  
          public string textBox1Text
          {
              get
              {
                  return textBox1Text = textBox1.Text;
              }
              set
              {
                 
              }
          }
      }
  }
  </code></pre>
  <p>So where are the OK and CANCEL buttons of the Form.ShowDialog?</p>