C#: How to make a AutoComplete textbox using Google API in WinForms
<p>I'm actually trying to make something like this but in WinForms: <a href="https://google-developers.appspot.com/maps/documentation/javascript/examples/full/places-autocomplete-addressform?hl=es" rel="nofollow">https://google-developers.appspot.com/maps/documentation/javascript/examples/full/places-autocomplete-addressform?hl=es</a></p>

<p>When you write some address, the TextBox expand and show you suggestions, and it updates every time you change the content of TextBox.</p>

<p>I write a method like <code>GetAddressPredictionsByInput(string input)</code> using Google API, but I dont know when I should call it, and how can I update suggestions like in the example, because if I change the <code>AutoCompleteCustomSource</code> everytime the <code>TextChanged</code> method is called, the control lost focus, and also too many calls to WebService freeze the program a little.</p>

<p>Hope you understand and help me.
Sorry for bad english.</p>

<p><strong>EDIT:</strong></p>

<p>Okey, I thought it wasn't necessary, this code is really simple and I explained it with words, but you down voted my question. This is my code:</p>

<pre><code>private void textBoxEx1_TypingCompleted(object sender, System.EventArgs e)
{
    var autoCompleteListCollection = new AutoCompleteStringCollection();
    autoCompleteListCollection.AddRange(new GoogleApi.Instance.GetAddressPredictionsByInput(textBoxEx1.Text).ToArray());
    textBoxEx1.AutoCompleteCustomSource = autoCompleteListCollection;
}
</code></pre>

<p><strong>Update:</strong> I partially answered my own question with:</p>

<p>I make a CustomControl that inherits TextBox and add a CustomEvent that is called when you stop typing for 2 seconds. Then, I call the method that returns an Array of Address (string) and I want to show it as suggestions.</p>