Normally, controls are being added to forms. But I need to do an opposite thing – add a Form instance to container user control.
The reason behind this is that I need to embed a third-party application into my own. Converting the form to a user control is not feasible due to complexity.
This is possible by setting the form’s TopLevel property to false. Which turns it into a child window, almost indistinguishable from a UserControl. Here’s a sample user control with the required code: