【发布时间】:2017-02-24 17:47:11
【问题描述】:
在使用轮询 Google Place API 的 WinForms c# 程序时遇到问题。
出于某种原因,我的组合框只显示我输入的第一个字母。一旦我输入一个字母,它就会删除旧字母并用新字母替换它。
请帮助我。这是我正在使用的代码。
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;
【问题讨论】:
-
这里没有足够的代码来帮助您诊断问题。你的组合框还有其他方法吗?
标签: c# winforms combobox autocomplete