title: How to stop Enter key from deleting ComboBox.Text (with AutoComplete)?
body: <p><strong>SOLVED:</strong> The issue was DropDownStyle.Simple</p>
  
  <p>Every time I press Enter when typing into folderComboBox it deletes the Text. </p>
  
  <p>It turns out that the problem doesn't occur in a fresh project. It only deletes the text when I use auto completion. </p>
  
  <pre class="lang-cs prettyprint-override"><code>ComboBox folderComboBox = new ComboBox();
  
  void folderComboBox_KeyUp(object sender, KeyEventArgs e)
  {
  
      if (e.KeyCode == Keys.Enter)
      {
          e.SuppressKeyPress = true;
          e.Handled = true;
      }
  }
  </code></pre>
  
  <ul>
  <li>I do not have a Form.AcceptButton (mentioned as an issue in another post).</li>
  </ul>
  
  <p>Similar Posts:</p>
  
  <ol>
  <li><a href="https://stackoverflow.com/questions/4760791/autocomplete-on-combobox-onkeypress-event-eats-up-the-enter-key">Autocomplete on Combobox onkeypress event eats up the Enter key</a></li>
  <li><a href="https://stackoverflow.com/questions/1226726/how-do-i-capture-the-enter-key-in-a-windows-forms-combobox">How do I capture the enter key in a windows forms combobox</a></li>
  </ol>