![](/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.