title: How to force a focus on a control in windows forms
body: <p>I am trying to focus a "search" textbox control in my windows forms application. This textbox is inside a user control, which is inside a panel which is inside a windows form (if it is important).
  I tried 3 methods which I could find:</p>
  
  <pre><code>// 1
  this.ActiveControl = myTextBox;
  
  // 2
  myTextBox.Focus();
  
  // 3
  myTextBox.Select();
  </code></pre>
  
  <p>Neither of them seems to work. I mean for example when I try the first one, active control is really set to myTextBox, but when I try to write something on keyboard, textbox doesn't accept it and I have to first click inside the textbox to get focus. This is same with all of the methods.
  Am I missing something?</p>