Version

MdiTabSettings Class

Maintains defaultable property settings for an MdiTab.
Syntax
'Declaration
 
Public Class MdiTabSettings 
   Inherits Infragistics.Shared.SubObjectBase
public class MdiTabSettings : Infragistics.Shared.SubObjectBase 
Remarks

The MdiTabSettings object is used to affect the appearance and behavior of an MdiTab object. The values are initialized with default values. These default values are resolved by a MdiTabSettingsResolved instance that may be accessed from the MdiTab using the MdiTab.SettingsResolved property.

The most commonly used properties of the class are the appearance properties. These properties are used to control the look of the tab items. The class exposes 4 tab appearances. The TabAppearance property is used to determine the default appearance for the tab. Usually the Image property is set on this property so that a particular image is displayed for a tab regardless of its state. The SelectedTabAppearance is used to augment the appearance of the tab when it is the MdiTabGroup.SelectedTab in its containing MdiTabGroup. When the tab is not selected, the values on this appearance are not used. The ActiveTabAppearance is similar to that of the SelectedTabAppearance in that the tab must be selected. However, just as there can be only one active mdi child, there is only one UltraTabbedMdiManager.ActiveTab. If there is only one tab group, then the active tab will be the selected tab since the active tab must be selected. However, when there is more than one tab group in the UltraTabbedMdiManager.TabGroups collection, only one tab group will contain the active tab. The appearance of that active tab will be affected by the ActiveTabAppearance. The last appearance property is the HotTrackTabAppearance. This appearance is used in the appearance resolution process when the mouse is over the tab item if the HotTrack property resolves to true.

The class contains several properties that affect the behavior of the tab. The AllowDrag property is used to determine whether a tab may be repositioned and to where. The AllowClose determines whether the close button is enabled when the tab is selected while the TabCloseAction determines the action that will be taken when the tab is closed.

Note: Only the font information for the tab appearances of the UltraTabbedMdiManager.TabSettings and TabSettings are used to determine the size of the tab items. The font information set on the Settings will affect the display but will not be used to determine the size of the MdiTabGroup.

Example
The following examples demonstrates how to set various MdiTabSettings and MdiTabGroupSettings properties which will serve as the default values for the MdiTabGroups and MdiTab objects managed by the UltraTabbedMdiManager component.

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

Private Sub InitializeTabbedMdi(ByVal mdiManager As UltraTabbedMdiManager)
    ' the same type (MdiTabSettings) is used for the 
    ' TabSettings of the UltraTabbedMdiManager - affects all tabs
    ' TabSettings of the MdiTabGroup - affects all tabs in group
    ' Settings of the MdiTab - affects the specific tab
    Me.InitializeTabSettings(mdiManager.TabSettings)

    ' the same type (MdiTabGroupSettings) is used for the 
    ' TabGroupSettings of the UltraTabbedMdiManager - affects all tab groups
    ' Settings of the MdiTabGroup - affects the specific tab group
    Me.InitializeTabGroupSettings(mdiManager.TabGroupSettings)
End Sub

Private Sub InitializeTabSettings(ByVal tabSettings As MdiTabSettings)
    ' allow tabs contained in the tab group to being closed
    tabSettings.AllowClose = DefaultableBoolean.True

    ' close the associated form when the close
    ' button is pressed
    tabSettings.TabCloseAction = MdiTabCloseAction.Close

    ' only allow tabs to be repositioned within its containing group
    tabSettings.AllowDrag = MdiTabDragStyle.WithinGroup

    ' do not use the icon of the associated for as
    ' the image for the tab
    tabSettings.DisplayFormIcon = DefaultableBoolean.False

    ' enable hot tracking - the tab will make use
    ' of the hot track appearance when the mouse is
    ' over the tab
    tabSettings.HotTrack = DefaultableBoolean.True

    ' when the mouse is over the tab, the forecolor
    ' should use the system's hot track color
    tabSettings.HotTrackTabAppearance.ForeColor = SystemColors.HotTrack

    ' when the tab is selected, use the system colors button
    ' colors
    tabSettings.SelectedTabAppearance.BackColor = SystemColors.ControlDarkDark
    tabSettings.SelectedTabAppearance.ForeColor = SystemColors.ControlLightLight
End Sub

Private Sub InitializeTabGroupSettings(ByVal groupSettings As MdiTabGroupSettings)
    ' display the close button in the tab group
    groupSettings.ShowCloseButton = DefaultableBoolean.True

    ' enable the automatic selection of a tab when the mouse
    ' is over a tab for a specific period of time
    groupSettings.AutoSelect = DefaultableBoolean.True

    ' wait 2 seconds when the mouse enters
    ' the bounds of the tab before it is selected automatically
    groupSettings.AutoSelectDelay = 0

    ' do not allow a tab's width to exceed 200 pixels
    groupSettings.MaxTabWidth = 200

    ' do not allow a tab's width to be less than 50 pixels
    groupSettings.MinTabWidth = 50

    ' put 2 pixels of padding around the image and text area
    groupSettings.TabPadding = New Size(2, 2)

    ' have the tabs aligned to the bottom of the tab group
    groupSettings.TabOrientation = TabOrientation.BottomLeft

    ' have the tab's size based on their image and text but
    ' they will be constrained to the limits set above
    groupSettings.TabSizing = TabSizing.AutoSize

    ' use worksheet style tabs
    groupSettings.TabStyle = TabStyle.Excel
End Sub
using Infragistics.Win;
using Infragistics.Win.UltraWinTabs;
using Infragistics.Win.UltraWinTabbedMdi;

private void InitializeTabbedMdi(UltraTabbedMdiManager mdiManager)
{
	// the same type (MdiTabSettings) is used for the 
	// TabSettings of the UltraTabbedMdiManager - affects all tabs
	// TabSettings of the MdiTabGroup - affects all tabs in group
	// Settings of the MdiTab - affects the specific tab
	this.InitializeTabSettings(mdiManager.TabSettings);

	// the same type (MdiTabGroupSettings) is used for the 
	// TabGroupSettings of the UltraTabbedMdiManager - affects all tab groups
	// Settings of the MdiTabGroup - affects the specific tab group
	this.InitializeTabGroupSettings(mdiManager.TabGroupSettings);
}

private void InitializeTabSettings( MdiTabSettings tabSettings )
{
	// allow tabs contained in the tab group to being closed
	tabSettings.AllowClose = DefaultableBoolean.True;

	// close the associated form when the close
	// button is pressed
	tabSettings.TabCloseAction = MdiTabCloseAction.Close;

	// only allow tabs to be repositioned within its containing group
	tabSettings.AllowDrag = MdiTabDragStyle.WithinGroup;

	// do not use the icon of the associated for as
	// the image for the tab
	tabSettings.DisplayFormIcon = DefaultableBoolean.False;

	// enable hot tracking - the tab will make use
	// of the hot track appearance when the mouse is
	// over the tab
	tabSettings.HotTrack = DefaultableBoolean.True;

	// when the mouse is over the tab, the forecolor
	// should use the system's hot track color
	tabSettings.HotTrackTabAppearance.ForeColor = SystemColors.HotTrack;

	// when the tab is selected, use the system colors button
	// colors
	tabSettings.SelectedTabAppearance.BackColor = SystemColors.ControlDarkDark;
	tabSettings.SelectedTabAppearance.ForeColor = SystemColors.ControlLightLight;
}

private void InitializeTabGroupSettings( MdiTabGroupSettings groupSettings )
{
	// display the close button in the tab group
	groupSettings.ShowCloseButton = DefaultableBoolean.True;

	// enable the automatic selection of a tab when the mouse
	// is over a tab for a specific period of time
	groupSettings.AutoSelect = DefaultableBoolean.True;

	// wait 2 seconds when the mouse enters
	// the bounds of the tab before it is selected automatically
	groupSettings.AutoSelectDelay = 0;

	// do not allow a tab's width to exceed 200 pixels
	groupSettings.MaxTabWidth = 200;

	// do not allow a tab's width to be less than 50 pixels
	groupSettings.MinTabWidth = 50;

	// put 2 pixels of padding around the image and text area
	groupSettings.TabPadding = new Size(2,2);

	// have the tabs aligned to the bottom of the tab group
	groupSettings.TabOrientation = TabOrientation.BottomLeft;

	// have the tab's size based on their image and text but
	// they will be constrained to the limits set above
	groupSettings.TabSizing = TabSizing.AutoSize;

	// use worksheet style tabs
	groupSettings.TabStyle = TabStyle.Excel;
}
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