![](/img/trans.png)
[英]c# wpf comboBox selecting items in the list when i type the first letter
[英]Autocomplete ComboBox only displays the first letter when I try and type in it
使用WinForms C#程序(輪詢Google Places API)時遇到問題。
由於某種原因,我的組合框僅顯示我鍵入的首字母。 當我輸入字母時,它會刪除舊字母並將其替換為新字母。
請幫我。 這是我正在使用的代碼。
var request = new PlacesAutoCompleteRequest
{
Key = "Not Telling",
Input = comboBoxStreetAddress.Text,
Sensor = true
};
var response = GooglePlaces.AutoComplete.Query(request);
var results = response.Predictions.ToArray();
AutoCompleteStringCollection array = new AutoCompleteStringCollection();
for (int x = 0; x < results.Count(); x++)
{
array.Add(results[x].Description);
}
comboBoxStreetAddress.AutoCompleteCustomSource = array;
似乎您的問題可能在其他地方。 聽起來有點像您每次輸入字母時組合框都重新獲得焦點。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.