Infragistics2.Win.UltraWinTabControl.v8.1
AllowClosing Property
See Also  Example
Infragistics.Win.UltraWinTabControl Namespace > UltraTab Class : AllowClosing Property

Gets or sets the value indicating whether the tab can be closed.

Syntax

Visual Basic (Declaration) 
Public Property AllowClosing As DefaultableBoolean
C# 
public DefaultableBoolean AllowClosing {get; set;}

Exceptions

ExceptionDescription
InvalidEnumArgumentException The value assigned is not defined in the DefaultableBoolean enumeration.

Remarks

If this property is Default, the value of UltraTabControlBase.AllowTabClosing will be used to determine if the tab can close.

Example

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

Visual BasicCopy Code
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinTabs

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

' Disable the close button in the first tab.
' This will also prevent middle clicking on the tab from closing it.
Me.UltraTabControl1.Tabs(0).AllowClosing = Infragistics.Win.DefaultableBoolean.False

' The second tab's close button should come before the image and text of the tab.
Me.UltraTabControl1.Tabs(1).CloseButtonAlignment = TabCloseButtonAlignment.BeforeContent

' The third tab should only display a close button when it is the selected tab.
Me.UltraTabControl1.Tabs(2).CloseButtonVisibility = TabCloseButtonVisibility.WhenSelected
C#Copy Code
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;

// Disable the close button in the first tab.
// This will also prevent middle clicking on the tab from closing it.
this.ultraTabControl1.Tabs[ 0 ].AllowClosing = DefaultableBoolean.False;

// The second tab's close button should come before the image and text of the tab.
this.ultraTabControl1.Tabs[ 1 ].CloseButtonAlignment = TabCloseButtonAlignment.BeforeContent;

// The third tab should only display a close button when it is the selected tab.
this.ultraTabControl1.Tabs[ 2 ].CloseButtonVisibility = TabCloseButtonVisibility.WhenSelected;

See Also