How to make c# don't call destructor of a instance
- by Bình Nguyên
I have two forms and form1 needs to get data from form2, i use a parameter in form2 constructor to gets form1's instance like this:
public form2(Form form1) {
this.f = form1;
}
and in form1:
Form form2 = new Form(this);
But it seem form1 destruct was called when i closed form1. my question is how can i avoid this problem?
EDIT: I have many typing mistakes in my question, i'm so sorry, fixed:
I have two forms and form2 needs to get data from form1, i use a parameter in form1 constructor to gets form1's instance like this:
private Form f;
public form2(Form form1) {
this.f = form1;
}
and in form1:
Form form2 = new Form(this);
But it seem form1 destruct was called when i closed form2. my question is how can i avoid this problem?