private async void SearchButton_ClickAsync(object sender, EventArgs e) { SetupListView(); Cursor = Cursors.WaitCursor; var ost = await SearchGoogleGeo(SearchTextBox.Text); Cursor = Cursors.Default; foreach (var item in ost.Results) { var lvi = new ListViewItem { Text = item.Formatted_address, Tag = item }; var latItem = new ListViewItem.ListViewSubItem { Text = item.Geometry.Location.Lat.ToString() }; var lonItem = new ListViewItem.ListViewSubItem { Text = item.Geometry.Location.Lng.ToString() }; lvi.SubItems.Add(latItem); lvi.SubItems.Add(lonItem); ResultListView.Items.Add(lvi); } ResultListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); ResultListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); }
private void ItemLookup_Load(object sender, EventArgs e) { StyleManager.Theme = MainForm.data.Theme; StyleManager.Style = MainForm.data.Colour; this.Theme = StyleManager.Theme; ResultListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); ResultListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); }
private void SetupListView() { ResultListView.Clear(); _ = new ListView.ColumnHeaderCollection(ResultListView) { "Adresse", "Latitude", "Longitude" }; ResultListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); ResultListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); }