private void addBtn_Click(object sender, EventArgs e) { Vehicul v = new Vehicul(); Form2 frm2 = new Form2(v); frm2.ShowDialog(); parc = parc + v; listView1.Items.Clear(); foreach (Vehicul veh in vehiculs) { ListViewItem itm = new ListViewItem(veh.ModelMasina); itm.SubItems.Add(veh.AnFabricatie.ToString()); itm.SubItems.Add(veh.Pret.ToString()); listView1.Items.Add(itm); } }
public Form2(Vehicul v) { this.v2 = v; InitializeComponent(); }