簡體   English   中英

自動填充組合框僅在我嘗試輸入時顯示第一個字母

[英]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;

似乎您的問題可能在其他地方。 聽起來有點像您每次輸入字母時組合框都重新獲得焦點。

當我嘗試在 Xamarin Forms

[英]Only the first item in a list is rendered when I try to output a collectionview inside a collectionview in Xamarin Forms

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM