I know there are many questions about this one, and I saw most of them but still non of them seems work for me. I have a parent and a child forms. Child form has two buttons - save and cancel, and I want when one of them is pressed to refresh the parent form(basically to get the new data).
I've tried passing the parent form as a parameter when calling .showDialog()
and then in the child function calling parentForm.Refresh()
and I can see that it's called but the form doesn't refreshes..
I've also tried adding this.Refresh()
in the parent form after the childForm.showDialog()
line with the hope that after the child form closes, the refresh will called.. doesn't work.
I've tried this without any luck as well
if (ftpsf.DialogResult == DialogResult.OK) // what button should I call when I don't OK?
{
this.Refresh();
}
And I've also tried subscribing to the close event of the child form, no success..
private void frm2_FormClosed(object sender, FormClosedEventArgs e)
{
this.Refresh();
}
Does anybody have any other suggestions?