private void driversListBox_SelectedIndexChanged(object sender, EventArgs e) { Racer selectedRacer = driversListBox.SelectedItem as Racer; if (!(selectedRacer is null)) { lapsListBox.DataSource = null; lapsListBox.DataSource = selectedRacer.Laps; String bestLap = selectedRacer.getBestLap((int)numericFilter.Value); if (bestLap is null) { bestLapTextBox.Text = "NO LAP EXISTS"; } else { bestLapTextBox.Text = bestLap; } } }
private void addDriverNOK_Click(object sender, EventArgs e) { this.Racer = null; this.Close(); }
public Form2(Racer racer) { InitializeComponent(); this.Racer = racer; }