Version

MdiTabGroupSettings Class

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

The MdiTabGroupSettings object is used to affect the appearance and behavior of MdiTabGroup instances. The values of each property are initialized with default values. These default values are resolved by a MdiTabGroupSettingsResolved instance that may be accessed from the group's MdiTabGroup.SettingsResolved property.

The most commonly used properties are the TabStyle and TabSizing. The TabStyle property is used to determine the look and feel of the tab items and affects the shape of the tab item borders. The TabSizing property determines how the size of the tab items is calculated. By default, tab items are sized based on the amount of space required to display the tab's image and text. The size may be constrained using the MinTabWidth and MaxTabWidth to ensure that the tab items are always within a reasonable size.

The class exposes several appearance properties that can be used to affect the appearance of the tab area (the area behind the tab items), scroll related items, tab list and close buttons. The tab area may be modified using the TabAreaAppearance. The scroll items can be modified using the ScrollTrackAppearance (scroll thumb and track and the ScrollButtonAppearance, which affects the scroll buttons and scroll thumb appearance. The CloseButtonAppearance will affect the appearance of the close button (displayed as an "X" in the tab group area). The TabListButtonAppearance will affect the appearance of the tab list button (displayed as a downward arrow indicator in the tab group area).

Several properties for manipulating the layout of the tab items are available in this class. The TabOrientation determines the area in which the tab items will be displayed. By default, the tab items are located on the top and positioned from left to right. This property may be used to position the items on the left, right or bottom. The TextOrientation is used to determine how the text of the tab is displayed with respect to the orientation of the tabs. TabPadding may be used to adjust the amount of space between the contents of the tab and the borders.

The class also has several properties to determine how and when scroll related items are displayed. The most commonly used of these are the ScrollButtons and ScrollButtonTypes.

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