HeaderPane
Main
Hide
Share Link
Print

TabCloseButtonOptionalEnum Enumeration

Defines when a tab shows its own close button, or that the control's setting applies.

Namespace: Softelvdm.SftTabsNET
Assembly: Softelvdm.SftTabsNET

Syntax

public enum TabCloseButtonOptionalEnum;
Public Enum TabCloseButtonOptionalEnum

Values

NameDescription
DefaultThe control's SftTabs.TabCloseButton property applies.
NoneThe tab has no close button.
SelectedOrHotThe tab shows a close button when it is selected or under the mouse cursor.
AlwaysThe tab always shows a close button.

Comments

Defines when a tab shows its own close button, or that the control's setting applies.

The TabClass.CloseButton property uses this enumeration.

Examples

C# View entire sample code

            colorDialog1.Color = sftTabs1.AccentColor;
            if (colorDialog1.ShowDialog(this) == DialogResult.OK)
                sftTabs1.AccentColor = colorDialog1.Color;
        }

        private void buttonAdd_Click(object sender, EventArgs e) {
            ++addedTabs;
            TabClass tab = sftTabs1.Tabs.Add("Added " + addedTabs.ToString());
            tab.CloseButton = TabCloseButtonOptionalEnum.Always;

            // the page of the new tab is created by the control
            Label info = new Label();
            info.Dock = DockStyle.Fill;
            info.Padding = new Padding(12);
            info.Text = "This tab was added by the Add Tab button. Its close button removes it.";
            tab.Page.Controls.Add(info);

VB.NET View entire sample code

    If ColorDialog1.ShowDialog(Me) = DialogResult.OK Then
        SftTabs1.AccentColor = ColorDialog1.Color
    End If
End Sub

Private Sub ButtonAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonAdd.Click
    addedTabs += 1
    Dim tab As TabClass = SftTabs1.Tabs.Add("Added " + addedTabs.ToString())
    tab.CloseButton = TabCloseButtonOptionalEnum.Always

    ' the page of the new tab is created by the control
    Dim info As New Label()
    info.Dock = DockStyle.Fill
    info.Padding = New Padding(12)
    info.Text = "This tab was added by the Add Tab button. Its close button removes it."
    tab.Page.Controls.Add(info)

See Also Classes | SftTabs/NET 3.0