[Solved] How can I pass a value from child form to parent form and back? [closed]


Define a Property for child form

// In Parent Form
addTriple a1 = new addTriple();

a1.G = graphicdata //assign graphic data here
a1.BringToFront();
a1.ShowDialog();
g.SaveToFile(this.s1);


// In Child Form
public Graph  G
{
    get { return gr; }
    set { gr = value; }
}

now you can have access to this anywere and assign data to it before showing the form

8

solved How can I pass a value from child form to parent form and back? [closed]