How to data pass from Child Form to Parent Form ??
// Parent form
public static Parent ParentRef { get; private set; }
public Parent()
{
InitializeComponent();
ParentRef = this;
}
public void datapass(string name,string result)
{
MessageBox.Show(name+result);
}
//Child form
private void bu_send_Click(object sender, EventArgs e)
{
var obj_parent = Parent.ParentRef;
obj_ot.datapass(textBox1.Text.Trim(),textBox2.Text.Trim());
this.Close();
}
// Parent form
public static Parent ParentRef { get; private set; }
public Parent()
{
InitializeComponent();
ParentRef = this;
}
public void datapass(string name,string result)
{
MessageBox.Show(name+result);
}
//Child form
private void bu_send_Click(object sender, EventArgs e)
{
var obj_parent = Parent.ParentRef;
obj_ot.datapass(textBox1.Text.Trim(),textBox2.Text.Trim());
this.Close();
}
No comments:
Post a Comment