'Declaration Public Class UltraTabStripControl Inherits UltraTabControlBase Implements Infragistics.Win.AppStyling.ISupportAppStyling, Infragistics.Win.IImageListProvider, Infragistics.Win.IUltraControl, Infragistics.Win.IUltraControlElement, Infragistics.Win.Notifications.INotificationBadgeSettingsOwner, Infragistics.Win.Touch.ISupportTouchMetrics, Infragistics.Win.UIAutomation.IProvideUIAutomation
public class UltraTabStripControl : UltraTabControlBase, Infragistics.Win.AppStyling.ISupportAppStyling, Infragistics.Win.IImageListProvider, Infragistics.Win.IUltraControl, Infragistics.Win.IUltraControlElement, Infragistics.Win.Notifications.INotificationBadgeSettingsOwner, Infragistics.Win.Touch.ISupportTouchMetrics, Infragistics.Win.UIAutomation.IProvideUIAutomation
UltraTabControl and UltraTabStripControl control both derive from the abstract base class UltraTabControlBase since the functionality of both controls is very similar.
The main difference is that the UltraTabControl creates a separate UltraTabPageControl for each tab so it can easily contain a separate set of child controls. This is similar to the functionality exposed by the TabControl provided by Microsoft.
In contrast, the UltraTabStripControl is a light weight control that re-uses its UltraTabControlBase.SharedControlsPage as the TabPage for every tab.
Note: the UltraTabStripControl can be easily bound to a data source via its DataSource, DataMember, TabKeyMember, TabTextMember, ToolTipTextMember, SortMember and SortDirection properties.
Imports Infragistics.Win Imports Infragistics.Win.UltraWinTabs Imports Infragistics.Win.UltraWinTabControl Private Sub InitializeTabStripControl() With Me.ultraTabStripControl1 ' Set the image background to conform and align with the ' form's BackgroundImage .TabHeaderAreaAppearance.ImageBackground = Me.BackgroundImage .TabHeaderAreaAppearance.ImageBackgroundOrigin = ImageBackgroundOrigin.Form ' Enable hot tracking (tabs hightlight as the mouse passes over them) .HotTrack = True ' Set the layout style of the tabs to a multi-row style .TabLayoutStyle = TabLayoutStyle.MultiRowTabsPerRow ' Set the MultiRowSelectionStyle to highlight the selected tab .MultiRowSelectionStyle = MultiRowSelectionStyle.HighlightTab ' Set the # of tabs per row .TabsPerRow = 4 ' Set the max # of visible rows to show .MaxVisibleTabRows = 5 ' Set the spacing between tabs of the same row and between ' tab rows .InterTabSpacing = New DefaultableInteger(3) .InterRowSpacing = New DefaultableInteger(5) ' Note: the following code sets the spacing back to there ' default values '.InterTabSpacing = DefaultableInteger.Default '.InterRowSpacing = DefaultableInteger.Default ' Set the margins around the tab page. .TabPageMargins.Top = 2 .TabPageMargins.Left = 2 .TabPageMargins.Right = 2 .TabPageMargins.Bottom = 2 ' Set the TabKeyMember. This will automatically initialize ' each tab's Key property to the data value in that column. .TabKeyMember = "CustomerID" ' Set the TabTextMember. This will automatically initialize ' each tab's Text property to the data value in that column. .TabTextMember = "CustomerName" ' Set the ToolTipTextMember. This will automatically initialize ' each tab's ToolTipText property to the data value in that column. .ToolTipTextMember = "Address" ' Set the SortMember. This will automatically sort the tabs ' based on the data values in that column. .SortMember = "CustomerName" ' Set the direction of the sort. .SortDirection = SortDirection.Descending ' Create an in-memory data source Me.CreateData() ' Bind the tab strip to the data source ' Note: This clears the Tabs collection and re-populates it ' with a tab for every row in the data source. .SetDataBinding(Me.dataSource, "") ' Note: Calling SetDataBinding is the same as setting the ' DataSource and DataMember properties individually ' but it does it in one atomic operation. '.DataSource = Me.dataSource '.DataMember = ' End With ' Set the data bindings for some textboxes 'Me.txtCustomerID.DataBindings.Add("Text", Me.dataSource, "CustomerID") 'Me.txtCustomerName.DataBindings.Add("Text", Me.dataSource, "CustomerName") End Sub
using System.Diagnostics; using Infragistics.Win; using Infragistics.Win.UltraWinTabs; using Infragistics.Win.UltraWinTabControl; private void InitializeTabStripControl() { // Set the image background to conform and align with the // form's BackgroundImage this.ultraTabStripControl1.TabHeaderAreaAppearance.ImageBackground = this.BackgroundImage; this.ultraTabStripControl1.TabHeaderAreaAppearance.ImageBackgroundOrigin = ImageBackgroundOrigin.Form; // Enable hot tracking (tabs hightlight as the mouse passes over them) this.ultraTabStripControl1.HotTrack = true; // Set the layout style of the tabs to a multi-row style this.ultraTabStripControl1.TabLayoutStyle = TabLayoutStyle.MultiRowTabsPerRow; // Set the MultiRowSelectionStyle to highlight the selected tab this.ultraTabStripControl1.MultiRowSelectionStyle = MultiRowSelectionStyle.HighlightTab; // Set the # of tabs per row this.ultraTabStripControl1.TabsPerRow = 4; // Set the max # of visible rows to show this.ultraTabStripControl1.MaxVisibleTabRows = 4; // Set the spacing between tabs of the same row and between // tab rows this.ultraTabStripControl1.InterTabSpacing = 3; this.ultraTabStripControl1.InterRowSpacing = 5; // Note: The following code does the same //this.ultraTabStripControl1.InterTabSpacing = new DefaultableInteger( 3 ); //this.ultraTabStripControl1.InterRowSpacing = new DefaultableInteger( 5 ); // Note: the following code sets the spacing back to there // default values //this.ultraTabStripControl1.InterTabSpacing = DefaultableInteger.Default; //this.ultraTabStripControl1.InterRowSpacing = DefaultableInteger.Default; // Set the margins around the tab page. this.ultraTabStripControl1.TabPageMargins.Top = 2; this.ultraTabStripControl1.TabPageMargins.Left = 2; this.ultraTabStripControl1.TabPageMargins.Right = 2; this.ultraTabStripControl1.TabPageMargins.Bottom = 2; // Set the TabKeyMember. This will automatically initialize // each tab's Key property to the data value in that column. this.ultraTabStripControl1.TabKeyMember = "CustomerID"; // Set the TabTextMember. This will automatically initialize // each tab's Text property to the data value in that column. this.ultraTabStripControl1.TabTextMember = "CustomerName"; // Set the ToolTipTextMember. This will automatically initialize // each tab's ToolTipText property to the data value in that column. this.ultraTabStripControl1.ToolTipTextMember = "Address"; // Set the SortMember. This will automatically sort the tabs // based on the data values in that column. this.ultraTabStripControl1.SortMember = "CustomerName"; // Set the direction of the sort. this.ultraTabStripControl1.SortDirection = SortDirection.Descending; // Create an in-memory data source this.CreateData(); // Bind the tab strip to the data source // Note: This clears the Tabs collection and re-populates it // with a tab for every row in the data source. this.ultraTabStripControl1.SetDataBinding( this.dataSource, "" ); // Note: Calling SetDataBinding is the same as setting the // DataSource and DataMember properties individually // but it does it in one atomic operation. //this.ultraTabStripControl1.DataSource = this.dataSource; //this.ultraTabStripControl1.DataMember = ""; // Set the data bindings for some textboxes //this.txtCustomerID.DataBindings.Add("Text", this.dataSource, "CustomerID"); //this.txtCustomerName.DataBindings.Add("Text", this.dataSource, "CustomerName"); }
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