HeaderPane
Main
Hide
Share Link
Print

CloseButtonClicked Event, SftTabs Class

Occurs when the control's Close button is clicked.

Class: SftTabs
Namespace: Softelvdm.SftTabsNET
Assembly: Softelvdm.SftTabsNET

Syntax

public event EventHandler CloseButtonClicked;
Public Event CloseButtonClicked As EventHandler

Comments

Occurs when the control's Close button is clicked.

Examples

C# View entire sample code

        private void sftTabs1_TabCloseButtonClicked(object sender, TabEventArgs e) {
            DumpValues("TabCloseButtonClicked", e);

            // the control does not remove the tab, the application does
            e.Tab.Remove();
        }

        private void sftTabs1_CloseButtonClicked(object sender, EventArgs e) {
            DumpValues("CloseButtonClicked", e);

            // the control's Close button removes the selected tab in this sample
            TabClass tab = sftTabs1.SelectedTab;
            if (tab != null)
                tab.Remove();
        }

VB.NET View entire sample code

Private Sub SftTabs1_TabCloseButtonClicked(ByVal sender As System.Object, ByVal e As Softelvdm.SftTabsNET.TabEventArgs) Handles SftTabs1.TabCloseButtonClicked
    DumpValues("TabCloseButtonClicked", e)

    ' the control does not remove the tab, the application does
    e.Tab.Remove()
End Sub

Private Sub SftTabs1_CloseButtonClicked(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SftTabs1.CloseButtonClicked
    DumpValues("CloseButtonClicked", e)

    ' the control's Close button removes the selected tab in this sample
    Dim tab As TabClass = SftTabs1.SelectedTab
    If tab IsNot Nothing Then
        tab.Remove()
    End If
End Sub

See Also SftTabs Class | Classes | SftTabs/NET 3.0