private void listBox1_MouseDoubleClick(object sender, MouseEventArgs e) { int index = this.listBox1.IndexFromPoint(e.Location); if (index != System.Windows.Forms.ListBox.NoMatches) { Object3D elementToModif = (Object3D)this.listBox1.Items[index]; if (elementToModif is form.Rectangle) { form.Rectangle elementToModifCast = (form.Rectangle)elementToModif; Form3 recModifier = new Form3(elementToModifCast); recModifier.setLB(this.listBox1); recModifier.Activate(); recModifier.Show(); } else if (elementToModif is Sphere) { Sphere elementToModifCast = (Sphere)elementToModif; Form2 spheremodif = new Form2(elementToModifCast); spheremodif.setLB(this.listBox1); spheremodif.Activate(); spheremodif.Show(); } } }
public Form3(form.Rectangle form, bool modif = false) { InitializeComponent(); this.color_rb.Checked = true; this.formToModif = form; this.tIsNewFIsModif = modif; this.remplir(); }