バージョン

SelectedTab プロパティ

グループ内の現在選択されている MdiTab を返すか、設定します。
シンタックス
'宣言
 
Public Property SelectedTab As MdiTab
public MdiTab SelectedTab {get; set;}
解説

SelectedTab は、タブ グループ内で選択されて現在・ヲしているタブを・オます。外観の違いは、解決された TabStyle と、MdiTabSettings の外観設定によって決まります。TabSettings を使用して、Tabs のデフォルトの外観を初期化できます。SelectedTab の外観は SelectedTabAppearance を使用して解決されます。

SelectedTabActiveTab を表す場合もあります。これは、ActiveTab は、そのタブを含むタブ グループの SelectedTab でなければならないためです。SelectedTab を設定すると、TabSelecting イベントが呼び出されます。このイベントがキャンセルされなければ、タブが選択されて TabSelected イベントが呼び出されます。

注: このプロパティは、Tabs が空の場合、または MdiTabGroup の TabGroups に他の MdiTabGroups インスタンスが含まれる場合は null を返します。

注: このプロパティを設定したときに、指定した MdiTabTabs コレクションに含まれていない場合は例外が生成されます。

使用例
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinTabs
Imports Infragistics.Win.UltraWinTabbedMdi

Private Sub MoveAllToFirstGroup()
    'There are multiple ways to reposition a group. Which you use
    'will depend upon what you are trying to accomplish although
    'there are usually several mechanisms for achieving the 
    'desired result. Here we are moving all the tabs from all
    'the tab groups into the first tab group. Several numbered
    'but commented out ways are presented to complete the task.
    '

    ' if there are no mdi tab groups, there is nothing to do
    If Not Me.ultraTabbedMdiManager1.HasTabGroups Then
        Return
    End If

    ' get the first group
    Dim firstGroup As MdiTabGroup = Me.ultraTabbedMdiManager1.TabGroups(0)
    Dim firstDisplayedTab As MdiTab = firstGroup.FirstDisplayedTab
    Dim selectedTab As MdiTab = firstGroup.SelectedTab

    Me.ultraTabbedMdiManager1.BeginUpdate()

    ' iterate through all the tab groups after
    ' the first one and move the tabs to the first group.
    ' we'll iterate backwards since removing all the tabs 
    ' in a group causes the group to get removed
    '
    Dim count As Integer = Me.ultraTabbedMdiManager1.TabGroups.Count - 1

    Dim i As Integer
    For i = count To 1 Step - 1
        Dim tabGroup As MdiTabGroup = Me.ultraTabbedMdiManager1.TabGroups(i)

        ' (1) The MoveAllTabs method is convenient to move all 
        ' the contained tabs to an existing tabgroup. the
        ' MdiTabGroupPosition parameter is used to determine
        ' the tab group which tab group, relative to the 
        ' calling tab group's current position
        'tabGroup.MoveAllTabs(MdiTabGroupPosition.First)

        ' The alternative is to iterate the tabs (backwards
        ' since moving the tab to a different group will
        ' remove it from the tabs collection of the containing
        ' group)
        Dim j As Integer
        For j = tabGroup.Tabs.Count - 1 To 0 Step - 1
            Dim tab As MdiTab = tabGroup.Tabs(j)

            ' (2) The Reposition method will take a tab object
            ' and move the invoking tab to the same tab group 
            ' as the specified tab and positioned relative to that tab
            '
            'tab.Reposition(firstGroup.SelectedTab, MdiTabPosition.Last)

            ' (3) Calling the MoveToGroup without specifying an index
            ' will move the tab to the specified group and position 
            ' it at the end. This is equivalent to calling:
            'tab.MoveToGroup(firstGroup, firstGroup.Tabs.Count)
            tab.MoveToGroup(firstGroup)
        Next

    Next

    ' reset the previously selected tab
    firstGroup.SelectedTab = selectedTab

    ' reinitialize the tab was previously the first displayed tab
    firstGroup.FirstDisplayedTab = firstDisplayedTab

    Me.ultraTabbedMdiManager1.EndUpdate()
End Sub
using Infragistics.Win;
using Infragistics.Win.UltraWinTabs;
using Infragistics.Win.UltraWinTabbedMdi;

private void MoveAllToFirstGroup()
{
	// There are multiple ways to reposition a group. Which you use
	// will depend upon what you are trying to accomplish although
	// there are usually several mechanisms for achieving the 
	// desired result. Here we are moving all the tabs from all
	// the tab groups into the first tab group. Several numbered
	// but commented out ways are presented to complete the task.
	// 

	// if there are no mdi tab groups, there is nothing to do
	if (!this.ultraTabbedMdiManager1.HasTabGroups)
		return;

	// get the first group
	MdiTabGroup firstGroup = this.ultraTabbedMdiManager1.TabGroups[0];
	MdiTab firstDisplayedTab = firstGroup.FirstDisplayedTab;
	MdiTab selectedTab = firstGroup.SelectedTab;

	this.ultraTabbedMdiManager1.BeginUpdate();

	// iterate through all the tab groups after
	// the first one and move the tabs to the first group.
	// we'll iterate backwards since removing all the tabs 
	// in a group causes the group to get removed
	//
	int count = this.ultraTabbedMdiManager1.TabGroups.Count - 1;

	for(int i = count; i > 0 ; i--)
	{
		MdiTabGroup tabGroup = this.ultraTabbedMdiManager1.TabGroups[i];

		// (1) The MoveAllTabs method is convenient to move all 
		// the contained tabs to an existing tabgroup. the
		// MdiTabGroupPosition parameter is used to determine
		// the tab group which tab group, relative to the 
		// calling tab group's current position
		tabGroup.MoveAllTabs(MdiTabGroupPosition.First);

		// The alternative is to iterate the tabs (backwards
		// since moving the tab to a different group will
		// remove it from the tabs collection of the containing
		// group)
		for(int j = tabGroup.Tabs.Count - 1; j >= 0; j--)
		{
			MdiTab tab = tabGroup.Tabs[j];

			// (2) The Reposition method will take a tab object
			// and move the invoking tab to the same tab group 
			// as the specified tab and positioned relative to that tab
			//
			tab.Reposition(firstGroup.SelectedTab, MdiTabPosition.Last);

			// (3) Calling the MoveToGroup without specifying an index
			// will move the tab to the specified group and position 
			// it at the end. This is equivalent to calling:
			tab.MoveToGroup(firstGroup, firstGroup.Tabs.Count);
			tab.MoveToGroup(firstGroup);
		}

	}

	// reset the previously selected tab
	firstGroup.SelectedTab = selectedTab;

	// reinitialize the tab was previously the first displayed tab
	firstGroup.FirstDisplayedTab = firstDisplayedTab;

	this.ultraTabbedMdiManager1.EndUpdate();
}
参照