I want to make some of my custom controls pop up into a new window. As I see it, it works, as the user control will remain where it is, but will send a copy of its current state to a new window. I also want this functionality to be in the base class, so derived classes will have this functionality.
Here is what I still have:
public class PopoutControl : XtraUserControl { public void Popout() { XtraForm PopoutForm = new XtraForm(); PopoutForm.Controls.Add(this); Dock = DockStyle.Fill; PopoutForm.Show(); } } public partial class PopoutControlTest : PopoutControl { public PopoutControlTest() { InitializeComponent(); } private void OnPopoutRequest(object sender, EventArgs e) { Popout(); } }
This works, except that it removes the user control from the original form, where it is located - to place it in the new form - how can I solve it?
source share