Back to Devexpress

XtraTabPage.ShowCloseButton Property

windowsforms-devexpress-dot-xtratab-dot-xtratabpage-757d767e.md

latest3.7 KB
Original Source

XtraTabPage.ShowCloseButton Property

Gets or sets whether the page contains a Close button.

Namespace : DevExpress.XtraTab

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(DefaultBoolean.Default)]
public virtual DefaultBoolean ShowCloseButton { get; set; }
vb
<DefaultValue(DefaultBoolean.Default)>
Public Overridable Property ShowCloseButton As DefaultBoolean

Property Value

TypeDefaultDescription
DefaultBooleanDefault

A DefaultBoolean value that specifies whether a Close button is displayed in the tab.

|

Available values:

NameDescriptionReturn Value
True

The value is true.

|

0

| | False |

The value is false.

|

1

| | Default |

The value is specified by a global option or a higher-level object.

|

2

|

Remarks

To display Close buttons in individual tab pages, set the XtraTabControl.ClosePageButtonShowMode property to an appropriate value. The ShowCloseButton property allows the Close button in specific pages to be hidden. To do this, set the ShowCloseButton property to False.

Note that by default, clicking Close buttons has no effect. Handle the XtraTabControl.CloseButtonClick event to respond to button clicking.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ShowCloseButton property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-tab-control-custom-header-buttons/CS/XtraTabControl_CustomButtons/Form1.cs#L19

csharp
ResourceImageHelper.CreateImageFromResources("XtraTabControl_CustomButtons.08.jpg", typeof(Form1).Assembly));
    xtraTabControl1.TabPages[0].ShowCloseButton = DefaultBoolean.False;
}

winforms-tab-control-custom-header-buttons/VB/XtraTabControl_CustomButtons/Form1.vb#L21

vb
AddImage("Start Page", ResourceImageHelperCore.CreateImageFromResources("XtraTabControl_CustomButtons.08.jpg", GetType(Form1).Assembly))
    xtraTabControl1.TabPages(0).ShowCloseButton = DefaultBoolean.False
End Sub

See Also

ClosePageButtonShowMode

CloseButtonClick

XtraTabPage Class

XtraTabPage Members

DevExpress.XtraTab Namespace