Articles in this section
Category / Section

How to equalize the bounds of tab group loaded in WinForms TabbedMDIManager?

3 mins read

Tab groups

In TabbedMDIManager, it is possible to equalize the bounds of Tab Group and display it in any combination of Matrix view like 3*3, 4*4 and 5*5 by using its following functions.

1)CreateNewVerticalGroup

2)CreateNewHorizontalGroup

3)AdjustTabGroupWeightsEqually

4)BalanceTDILayout

 

CreateNewVerticalGroup - This functions helps to create new Vertical Tab Group.

CreateNewHorizontalGroup - This functions helps to create new Vertical Tab Group.

AdjustTabGroupWeightsEqually - This function helps to divide the layout and allocate equal space for loaded Tab Groups.

BalanceTDILayout - This function used to define the number of rows that has to be split up in TabbedMDIManager and it has to be initialized once MDI Child is loaded in TabbedMDIManager.

C#

//To attach TabbedMDIManager to form
this.tabbedMDIManager.AttachToMdiContainer(this);
//Set the tab group height and width at the run time
//MDI child creation
Form frm = new Form();
//Set MDI parent form of this form
frm.MdiParent = this;
//Set the title of the MDI Child
frm.Text = "test0";
//To show the MDI Child
frm.Show();
Form frm1 = new Form();
frm1.MdiParent = this;
frm1.Text = "test1";
frm1.Show();
//Creates a new vertical tab group, moving the active MDI child to that group
this.tabbedMDIManager.CreateNewVerticalGroup();
Form frm2 = new Form();
frm2.MdiParent = this;
frm2.Text = "test2";
frm2.Show();
this.tabbedMDIManager.CreateNewVerticalGroup();
//Divides the MDI child layout equally
tabbedMDIManager.AdjustTabGroupWeightsEqually();
Form frm3 = new Form();
frm3.MdiParent = this;
frm3.Text = "test3";
frm3.Show();
//Creates a new Horizontal tab group, moving the active MDI child to that group
this.tabbedMDIManager.CreateNewHorizontalGroup();
this.tabbedMDIManager.MdiChildren[1].Focus();
Form frm4 = new Form();
frm4.MdiParent = this;
frm4.Text = "test4";
frm4.Show();
this.tabbedMDIManager.CreateNewHorizontalGroup();
this.tabbedMDIManager.MdiChildren[0].Focus();
Form frm5 = new Form();
frm5.MdiParent = this;
frm5.Text = "test5";
frm5.Show();
this.tabbedMDIManager.CreateNewHorizontalGroup();
Form frm6 = new Form();
frm6.MdiParent = this;
frm6.Text = "test6";
frm6.Show();
this.tabbedMDIManager.CreateNewHorizontalGroup();
this.tabbedMDIManager.MdiChildren[4].Focus();
Form frm7 = new Form();
frm7.MdiParent = this;
frm7.Text = "test7";
frm7.Show();
this.tabbedMDIManager.CreateNewHorizontalGroup();
this.tabbedMDIManager.MdiChildren[3].Focus();
Form frm8 = new Form();
frm8.MdiParent = this;
frm8.Text = "test8";
frm8.Show();
this.tabbedMDIManager.CreateNewHorizontalGroup();
//To maintain the equal size for loaded TabGroup
this.tabbedMDIManager.BalanceTDILayout(4);

VB

'To attach TabbedMDIManager to form
Me.tabbedMDIManager.AttachToMdiContainer(Me)
'Set the tab group height and width at the run time
'MDI child creation
Dim frm As New Form()
'Set MDI parent form of this form
frm.MdiParent = Me
'Set the title of the MDI Child
frm.Text = "test0"
'To show the MDI Child
frm.Show()
Dim frm1 As New Form()
frm1.MdiParent = Me
frm1.Text = "test1"
frm1.Show()
'Creates a new vertical tab group, moving the active MDI child to that group
Me.tabbedMDIManager.CreateNewVerticalGroup()
Dim frm2 As New Form()
frm2.MdiParent = Me
frm2.Text = "test2"
frm2.Show()
Me.tabbedMDIManager.CreateNewVerticalGroup()
' Divides the MDI child layout equally
tabbedMDIManager.AdjustTabGroupWeightsEqually()
Dim frm3 As New Form()
frm3.MdiParent = Me
frm3.Text = "test3"
frm3.Show()
'Creates a new Horizontal tab group, moving the active MDI child to that group
Me.tabbedMDIManager.CreateNewHorizontalGroup()
Me.tabbedMDIManager.MdiChildren(1).Focus()
Dim frm4 As New Form()
frm4.MdiParent = Me
frm4.Text = "test4"
frm4.Show()
Me.tabbedMDIManager.CreateNewHorizontalGroup()
Me.tabbedMDIManager.MdiChildren(0).Focus()
Dim frm5 As New Form()
frm5.MdiParent = Me
frm5.Text = "test5"
frm5.Show()
Me.tabbedMDIManager.CreateNewHorizontalGroup()
Dim frm6 As New Form()
frm6.MdiParent = Me
frm6.Text = "test6"
frm6.Show()
Me.tabbedMDIManager.CreateNewHorizontalGroup()
Me.tabbedMDIManager.MdiChildren(4).Focus()
Dim frm7 As New Form()
frm7.MdiParent = Me
frm7.Text = "test7"
frm7.Show()
Me.tabbedMDIManager.CreateNewHorizontalGroup()
Me.tabbedMDIManager.MdiChildren(3).Focus()
Dim frm8 As New Form()
frm8.MdiParent = Me
frm8.Text = "test8"
frm8.Show()
Me.tabbedMDIManager.CreateNewHorizontalGroup()
'Maintains the equal size for loaded TabGroup. This function has to be called after MDI Child is loaded in TabbedMDIManager.
Me.tabbedMDIManager.BalanceTDILayout(4)

The following screenshot illustrates the output.

Show the equalize tab groups

Figure 1: Equalize the Tab groups

Samples:

C#: How to equalize the height and width of MDI child in TabbedMDIManager C#

VB: How to equalize the height and width of MDI child in TabbedMDIManager VB?

Reference link: https://help.syncfusion.com/windowsforms/tabbedmdi/tab-groups

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