Version

CloseButtonLocation Property

Gets or sets the location of close buttons within the control.
Syntax
'Declaration
 
Public Property CloseButtonLocation As Infragistics.Win.UltraWinTabs.TabCloseButtonLocation
public Infragistics.Win.UltraWinTabs.TabCloseButtonLocation CloseButtonLocation {get; set;}
Exceptions
ExceptionDescription
System.ComponentModel.InvalidEnumArgumentExceptionThe value assigned is not defined in the Infragistics.Win.UltraWinTabs.TabCloseButtonLocation enumeration.
Remarks

Setting this property to None will prevent a middle mouse button click from closing a tab.

Example
The following code demonstrates how to control the behavior of a close button within a tab at a tab control level.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinTabs

' Place close buttons in all the tabs of the tab control.
Me.UltraTabControl1.CloseButtonLocation = TabCloseButtonLocation.Tab

' The close button in all tabs should be disabled as well as the ability to middle click and close the tab
' unless that tab has overriden the setting by having a non-default AllowClosing.
Me.UltraTabControl1.AllowTabClosing = False

' The close button in all tabs should come before the image and text of the tab 
' unless that tab has overriden the setting by having a non-default CloseButtonAlignment.
Me.UltraTabControl1.TabCloseButtonAlignment = TabCloseButtonAlignment.BeforeContent

' All tabs should only display the clos ebutton when they are selected or when the mouse is over them
' unless that tab has overriden the setting by having a non-default CloseButtonVisibility.
' For the close button to show when the tab is hot tracked, UseHotTracking must be True.
Me.UltraTabControl1.TabCloseButtonVisibility = TabCloseButtonVisibility.WhenSelectedOrHotTracked
Me.UltraTabControl1.UseHotTracking = DefaultableBoolean.True
using System.Windows.Forms;
using Infragistics.Win;
using Infragistics.Win.UltraWinTabs;

// Place close buttons in all the tabs of the tab control.
this.ultraTabControl1.CloseButtonLocation = TabCloseButtonLocation.Tab;

// The close button in all tabs should be disabled as well as the ability to middle click and close the tab
// unless that tab has overriden the setting by having a non-default AllowClosing.
this.ultraTabControl1.AllowTabClosing = false;

// The close button in all tabs should come before the image and text of the tab 
// unless that tab has overriden the setting by having a non-default CloseButtonAlignment.
this.ultraTabControl1.TabCloseButtonAlignment = TabCloseButtonAlignment.BeforeContent;

// All tabs should only display the clos ebutton when they are selected or when the mouse is over them
// unless that tab has overriden the setting by having a non-default CloseButtonVisibility.
// For the close button to show when the tab is hot tracked, UseHotTracking must be True.
this.ultraTabControl1.TabCloseButtonVisibility = TabCloseButtonVisibility.WhenSelectedOrHotTracked;
this.ultraTabControl1.UseHotTracking = DefaultableBoolean.True;
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