Articles in this section
Category / Section

How to use UserControls as WinForms TabbedMDIManager’s children?

1 min read

Use usercontrol as TabbedMDIManagers child

Normally tabbed-MDI is used in MDI applications where the child forms are the children that get tabbed. But it is also possible to use tabbed-MDI with UserControls as its children and that are dockable. Please refer the below code snippet which illustrates this:

C#

this.IsMdiContainer = true;
this.tb.AttachToMdiContainer(this);
this.userControl11.Parent = this;
this.userControl21.Parent = this;
// Dock the usercontrol11 to the form
this.dockingManager1.DockControl(this.userControl11, this, DockingStyle.Bottom, 200);
// Make userControl11 as other controls parent
this.dockingManager1.DockControl(this.userControl21, this.userControl11, DockingStyle.Tabbed, 200);
// Set the usercontrols to MDI mode
this.dockingManager1.SetAsMDIChild(this.userControl11, true);
this.dockingManager1.SetAsMDIChild(this.userControl21, true);

VB

Me.IsMdiContainer = True
Me.tb.AttachToMdiContainer(Me)
Me.UserControl11.Parent = Me
Me.UserControl21.Parent = Me
' Dock the usercontrol11 to the form
Me.dockingManager1.DockControl(Me.UserControl11, Me, DockingStyle.Bottom, 200)
' Make userControl11 as other controls parent
Me.dockingManager1.DockControl(Me.UserControl21, Me.UserControl11, DockingStyle.Tabbed, 200)
' Set the usercontrols to MDI mode
Me.dockingManager1.SetAsMDIChild(Me.UserControl11, True)
Me.dockingManager1.SetAsMDIChild(Me.UserControl21, True)

 

Reference link: https://help.syncfusion.com/windowsforms/tabbedmdi/usercontrols-as-tabs

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied