title: Windows Form Combobox DropDown event causing dialog form to lose focus
body: <p>I'm creating a settings form that is quite similar to the Visual Studio 2008 "Connect To Database" form in the Server Explorer.  </p>
  
  <p>The settings form is opened as a modal dialog from the parent form as follows:</p>
  
  <pre><code>    private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
      {
          var SettingsForm = new frmSettings();
          SettingsForm.ShowDialog(this); 
      }
  </code></pre>
  
  <p>On the SettingsForm, I have a ComboBox that will populate its list with the SQLServer instance names available on the network through the following code in the DropDown event:</p>
  
  <pre><code>    private void cboTrackingServerName_DropDown(object sender, EventArgs e)
      {
          DataTable dt = SmoApplication.EnumAvailableSqlServers(false);
          if (dt.Rows.Count &gt; 0)
          {
              cboTrackingServerName.Items.Clear();
  
              foreach (DataRow row in dt.Rows)
              {
                  cboTrackingServerName.Items.Add(
                       row["Server"] + "\\" + row["Instance"]);
              }
          }
      }
  </code></pre>
  
  <p>The problem is that whenever the user clicks the DropDown arrow on the ComboBox, the SettingsForm loses focus to its parent form for a quick second, the SettingsForm appears to redraw itself, and then the SettingsForm regains focus.  This also causes the actual DropDown list not to appear until the user clicks it again.</p>
  
  <p>Any helpful thoughts on the matter?</p>