HeaderPane
Main
Hide
Share Link
Print

CancelMode Method, SftTabs Object

Cancels current processing modes.

Syntax

VBobject.CancelMode

object

A SftTabs object.

Comments

The CancelMode method cancels current processing modes.

Applications may wish to respond to events such as MouseDown, TabClicked. Many mouse related events may have built-in functions which may be started after these events are processed. If an application wants to suppress the built-in behavior, e.g. to display a context menu, the internal state of the control has to be cleared. This can be accomplished using the CancelMode method.

Example

This example adds a checkbox to the second tab. Clicking on the checkbox doesn't change the active tab (because of the call to CancelMode), but toggles the checkbox instead.

Private Sub Form_Load()
    With SftTabs1.Direct
        .Style = styleSftTabsModernTop
        .Tab(1).Image.Appearance = sftImageCheckboxNo
    End With
End Sub

Private Sub SftTabs1_TabClicked(ByVal DblClick As Boolean, ByVal TabClicked As Integer, ByVal TabArea As SftTabsLib70.SftTabsTabAreaConstants)
    With SftTabs1.Direct
        If TabArea = tabareaSftTabsImage Then
            If .Tab(TabClicked).Image.Appearance = sftImageCheckboxNo Then
                .Tab(TabClicked).Image.Appearance = sftImageCheckboxYes
                .CancelMode
            ElseIf .Tab(TabClicked).Image.Appearance = sftImageCheckboxYes Then
                .Tab(TabClicked).Image.Appearance = sftImageCheckboxNo
                .CancelMode
            End If
        End If
    End With
End Sub

Examples

VB6 View entire sample code

Private Sub SftTabs1_TabClicked(ByVal DblClick As Boolean, ByVal TabClicked As Integer, ByVal TabArea As SftTabsLib70.SftTabsTabAreaConstants)
    ' a tab has been clicked
    ' check if a checkbox was clicked. If so, toggle it and prevent tab switching
    If TabArea = tabareaSftTabsImage Then
        Dim tb As SftTabsTab
        Set tb = SftTabs1.Tab(TabClicked)
        If tb.Image.Appearance = sftImageCheckboxYes Then
            tb.Image.Appearance = sftImageCheckboxNo
            SftTabs1.CancelMode
        ElseIf tb.Image.Appearance = sftImageCheckboxNo Then
            tb.Image.Appearance = sftImageCheckboxYes
            SftTabs1.CancelMode
        End If
    End If
End Sub

See Also SftTabs Object | Object Hierarchy


Last Updated 11/19/2026 - (email)
© 2026 Softel vdm, Inc.