I have a wpf user control with a text box and a checkbox. The usercontrol is presented in a winforms Tab control using a element host. I would like the user control to pop out into a brand new winform by clicking a button on the user control.
I tried a sample project and I can simply do this by
void button1_Click(object sender, EventArgs e)
{
Form frm = new Form();
UserControl uc = userControl11;
frm.Controls.Add(uc);
frm.Show();
}
However, I would like a way so that the user can click a button to pop out the user control into a new form and then click the same button to close the new pop out form and show the control back in the tab page. Obviously, all the user entered data should still be present. Any thoughts?