title: How to determine whether TextChanged was triggered by keyboard in C#?
body: <p>I have a method </p>
  
  <pre><code>private void textBoxPilot_TextChanged(object sender, TextChangedEventArgs e)
  { ... }
  </code></pre>
  
  <p>where the textbox in question takes a search string from the user and populates a <code>ListBox</code> with the results on every keystroke.</p>
  
  <p>Subsequently, when an item is picked from the <code>ListBox</code>, I would like the choice reflected in the same <code>Textbox</code>. However, I don't want to trigger the search mechanism, which would cause the <code>Listbox</code> to forget its selection.</p>
  
  <p>How can I determine whether the <code>TextChanged</code> event was triggered by the user (via they keyboard or maybe copy/paste) or by another method using <code>textBoxPilot.Text = "Pilot name";</code>?</p>
  
  <p>Thanks.</p>