title: Windows C# Form: Prompt focus on a textbox
body: <p>I was wondering how would I auto select a textbox when using a Prompt on windows form. My code below shows what I have tried, but it is still focusing on the button and not the textbox. Thank you in advance for the help and assistance.</p>
  
  <pre><code>            Form prompt = new Form();
              prompt.Width = 500;
              prompt.Height = 200;
              prompt.Text = caption;
              Label textLabel = new Label() { Left = 50, Top = 20, Text = text };
              TextBox textBox = new TextBox() { Left = 50, Top = 50, Width = 400 };
              Button confirmation = new Button() { Text = "Ok", Left = 50, Width = 100, Top = 90 };
              confirmation.Click += (sender, e) =&gt; { prompt.Close(); };
              textBox.Select();
              textBox.Focus();
              prompt.Controls.Add(confirmation);
              prompt.Controls.Add(textLabel);
              prompt.Controls.Add(textBox);
              prompt.ShowDialog();
              return textBox.Text;
  </code></pre>