Version

ActiveTab Property

Returns the MdiTab instance representing the current System.Windows.Forms.Form.ActiveMdiChild of the MdiParent
Syntax
'Declaration
 
Public ReadOnly Property ActiveTab As MdiTab
public MdiTab ActiveTab {get;}
Remarks

The ActiveTab is the MdiTab object representing the System.Windows.Forms.Form.ActiveMdiChild of the MdiParent. You can access the tabs for specific System.Windows.Forms.Form objects using the TabFromForm method.

Since the ActiveTab represents the active mdi tab and mdi child form activation is maintained by their zorder, the ActiveTab must be the MdiTabGroup.SelectedTab of its TabGroup. Since the ActiveTab must be selected, as the ActiveTab changes, the TabSelecting event will be invoked.

Note: The TabSelecting event may not always be cancellable since the activation may occur as a result of an external action - e.g. when the mdi child is first created.

Example
The following examples shows how to use the MoveToGroup and MoveToNewGroup methods to move a tab to a different MdiTabGroup.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinTabs
Imports Infragistics.Win.UltraWinTabbedMdi

Private Sub MoveToNewGroup()
    ' get the tab associated with the active form
    Dim activeTab As MdiTab = Me.ultraTabbedMdiManager1.ActiveTab

    ' if there isn't one or the form is being closed or hidden,
    ' skip it
    If activeTab Is Nothing Or Not activeTab.IsFormVisible Then
        Return
    End If

    ' Create a new tab group at the end and move the
    ' active tab to it. The following statements will 
    ' perform the same action. The overloads that 
    ' accept an MdiTabGroupPosition can be used to have 
    ' the new group created at the beginning or before/after 
    ' the current tab group.
    '
    'Me.ultraTabbedMdiManager1.MoveToNewGroup(activeTab, MdiTabGroupPosition.Last)
    'Me.ultraTabbedMdiManager1.MoveToNewGroup(activeTab)
    'activeTab.MoveToNewGroup(MdiTabGroupPosition.Last)
    If Me.ultraTabbedMdiManager1.CanCreateNewGroup Then
        activeTab.MoveToNewGroup()
    End If
End Sub

Private Sub MoveToNextGroup()
    ' get the tab associated with the active form
    Dim activeTab As MdiTab = Me.ultraTabbedMdiManager1.ActiveTab

    ' if there isn't one or the form is being closed or hidden,
    ' skip it
    If activeTab Is Nothing Or Not activeTab.IsFormVisible Then
        Return
    End If

    ' Move the currently active tab to the next group.
    ' The following statement performs the same action.
    ' 
    'Me.ultraTabbedMdiManager1.MoveToGroup(activeTab, MdiTabGroupPosition.Next)
    activeTab.MoveToGroup(MdiTabGroupPosition.Next)
End Sub

Private Sub MoveToPreviousGroup()
    ' get the tab associated with the active form
    Dim activeTab As MdiTab = Me.ultraTabbedMdiManager1.ActiveTab

    ' if there isn't one or the form is being closed or hidden,
    ' skip it
    If activeTab Is Nothing Or Not activeTab.IsFormVisible Then
        Return
    End If

    ' Move the currently active tab to the next group.
    ' The following statement performs the same action.
    ' 
    'Me.ultraTabbedMdiManager1.MoveToGroup(activeTab, MdiTabGroupPosition.Previous)
    activeTab.MoveToGroup(MdiTabGroupPosition.Previous)

End Sub
using Infragistics.Win;
using Infragistics.Win.UltraWinTabs;
using Infragistics.Win.UltraWinTabbedMdi;

private void MoveToNewGroup()
{
	// get the tab associated with the active form
	MdiTab activeTab = this.ultraTabbedMdiManager1.ActiveTab;

	// if there isn't one or the form is being closed or hidden,
	// skip it
	if (activeTab == null || !activeTab.IsFormVisible)
		return;

	// Create a new tab group at the end and move the
	// active tab to it. The following statements will 
	// perform the same action. The overloads that 
	// accept an MdiTabGroupPosition can be used to have 
	// the new group created at the beginning or before/after 
	// the current tab group.
	//
	//this.ultraTabbedMdiManager1.MoveToNewGroup(activeTab, MdiTabGroupPosition.Last);
	//this.ultraTabbedMdiManager1.MoveToNewGroup(activeTab);
	//activeTab.MoveToNewGroup(MdiTabGroupPosition.Last);
	if (this.ultraTabbedMdiManager1.CanCreateNewGroup)
		activeTab.MoveToNewGroup();
}

private void MoveToNextGroup()
{
	// get the tab associated with the active form
	MdiTab activeTab = this.ultraTabbedMdiManager1.ActiveTab;

	// if there isn't one or the form is being closed or hidden,
	// skip it
	if (activeTab == null || !activeTab.IsFormVisible)
		return;

	// Move the currently active tab to the next group.
	// The following statement performs the same action.
	// 
	//this.ultraTabbedMdiManager1.MoveToGroup(activeTab, MdiTabGroupPosition.Next);
	activeTab.MoveToGroup(MdiTabGroupPosition.Next);
}

private void MoveToPreviousGroup()
{
	// get the tab associated with the active form
	MdiTab activeTab = this.ultraTabbedMdiManager1.ActiveTab;

	// if there isn't one or the form is being closed or hidden,
	// skip it
	if (activeTab == null || !activeTab.IsFormVisible)
		return;

	// Move the currently active tab to the next group.
	// The following statement performs the same action.
	// 
	//this.ultraTabbedMdiManager1.MoveToGroup(activeTab, MdiTabGroupPosition.Previous);
	activeTab.MoveToGroup(MdiTabGroupPosition.Previous);

}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also