示例#1
0
 private void AddressSuggestions_Updated(object sender, AddressSuggestionsUpdatedEventArgs eventArgs)
 {
     try
     {
         ThreadingHelpers.BeginUpdate(MyComboBox);
         var text = ThreadingHelpers.GetText(MyComboBox);
         ThreadingHelpers.ClearItems(MyComboBox);
         foreach (var addressSuggestions in eventArgs.AddressSuggestions)
         {
             ThreadingHelpers.AddItem(MyComboBox, addressSuggestions);
         }
         ThreadingHelpers.SetDroppedDown(MyComboBox, true);
         ThreadingHelpers.ClearSelection(MyComboBox);
         ThreadingHelpers.SetText(MyComboBox, text);
         ThreadingHelpers.SetSelectionStart(MyComboBox, text.Length);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
     finally
     {
         ThreadingHelpers.EndUpdate(MyComboBox);
     }
 }