I have a form opening in tabcontrol. Through this a child form apears in the screen. when i pass value from child form parent form it gives error of ownership (Main form). when I changed the ownership of the form to the other form, error of ownershiop has gone. But a new error has come, that my child form does not passing values to other parent form.
My code is given below, when the child form is going to be open.
- private void button11_Click(object sender, EventArgs e)
- {
- using (New_Category new_Category = new New_Category("ProductDefinition"))
- {
- new_Category.ShowDialog();
- }
- }
and now the child form value passing to parent form
- Product_Defination prod = new Product_Defination("","");
- Main_form main = new Main_form("", "");
- prod.Owner = (Main_form)this.Owner;
- prod.get_productid_notifyme(Product_id);
What should i do that my parent form accept the values from child form.
Point to be noted that when i removed the coding of tabcontrol then this code is ok.