/// <summary> /// Открываем машину /// </summary> private void carClick(object sender, EventArgs e) { Button btn = (Button)sender; LadaForm lada = new LadaForm(btn.Text); lada.Show(); }
/// <summary> /// Открываем машину /// </summary> public static void carClick2(object sender, EventArgs e) { for (int i = 0; i < car_list.Count; i = i + 1) { if (((PictureBox)sender).Image == car_list[i].picture.Image) { LadaForm lada = new LadaForm(car_list[i]); lada.Show(); } } }
/// <summary> /// Открываем машину /// </summary> public static void carClick(object sender, EventArgs e) { for (int i = 0; i < car_list.Count; i = i + 1) { if (((Button)sender).Text == car_list[i].btn.Text) { LadaForm lada = new LadaForm(car_list[i]); lada.Show(); } } }