private void CarView_FormClosed(object sender, FormClosedEventArgs e)//изменения в форму родителя { ObjectsList objectsList = this.Owner as ObjectsList; objectsList.FillGrid(); carPic.Image.Dispose(); }
private void CarEdit_FormClosed(object sender, FormClosedEventArgs e)//изменение формы родителя { try { ObjectView carView = this.Owner as ObjectView; if (nameBox.Text == "" || numBox.Text == "" || priceBox.Text == "") { Data.Objects.DelObject(Data.CurrentObject); carView.Close(); } carView.FillForm(Data.CurrentObject); } catch { ObjectsList carsList = this.Owner as ObjectsList; carsList.FillGrid(); } }