title: How to prevent user control from stealing focus?
body: <p>I created a user control that functions as a keyboard.  I arranged the buttons in the control in the exact same manner as a keyboard, and set <code>(ControlStyles.Selectable, false)</code>.  This allows the focus to stay in a textbox that the user selected on the parent form.  I also set the style of the user control to not be selectable.  Everything works great when the user presses the buttons, but when the user control gets clicked, it steals the focus away from the textbox.  Here is my code:</p>
  
  <pre><code>public partial class TouchKeyboard : UserControl
      {
          public TouchKeyboard()
          {
              InitializeComponent();
              SetStyle(ControlStyles.Selectable, false);
  
          }
  
          private void TouchKeyboard_Load(object sender, EventArgs e)
          {
              foreach (var button in this.Controls.OfType&lt;CustomControls.CustomButton&gt;())
              {
                  button.Click += new EventHandler(this.ButtonClick);
              }
          }
  
          private void ButtonClick(object sender, EventArgs e)
          {
              var button = sender as CustomControls.CustomButton;
  
              if (button.Name == "btnSpace")
              {
                  SendKeys.Send(" ");
              }
              else
              {
                  SendKeys.Send("{" + button.Text + "}");
              }
          }
      }
  </code></pre>
  
  <p>Why would my user control steal focus when <code>ControlStyles.Selectable</code> is set to false?</p>