I had a similar problem in the past.
What I did first is to switch from Usercontrol inheritance to tabs, for example:
class UserInterface: UserControl // Make a constructor bit, then change it to
class UserInterface: TabPage
Second i Just put all my controls and stuff in the usercontrol and pin it to the tab.
Third, I made a general class that takes any user control and does the docking automatically.
so that you can take your "UserInterface" class and just get the type you can add to System.Windows.Forms.TabControl
public class UserTabControl<T> : TabPage where T : UserControl, new () { private T _userControl; public T UserControl { get{ return _userControl;} set { _userControl = value; OnUserControlChanged(EventArgs.Empty); } } public event EventHandler UserControlChanged; protected virtual void OnUserControlChanged(EventArgs e) {
source share