private void textboxvon_KeyUp(object sender, KeyEventArgs e) { listBox1.Items.Clear(); Stations resultat = transport.GetStations(textboxvon.Text); foreach (Station station in resultat.StationList) { listBox1.Items.Add(station.Name); } }
// Start Destination private void Tbxfrom_TextChanged(object sender, EventArgs e) { { var textBox = new TextBox(); lbxdisplay1.Show(); Stations = Transport.GetStations(tbxfrom.Text); lbxdisplay1.DataSource = Stations.StationList; lbxdisplay1.DisplayMember = "Name"; } }
// gets possible stations for the input public List <Station> getPossibleStations(string station) { List <Station> possibleStations; ITransport transport = new Transport(); possibleStations = transport.GetStations(station).StationList; return(possibleStations); }
private void txtStart_TextChanged(object sender, EventArgs e) { if (_changed == false) { if (!(txtStart.Text.Length == 0)) { listStart.Visible = true; listStart.Items.Clear(); string start = txtStart.Text; var station = transport.GetStations(start); foreach (var stat in station.StationList) { listStart.Items.Add(stat.Name); } } else { listStart.Visible = false; } } }