HeaderPane
Main
Hide
Share Link
Print

MouseDown Event, SftTabs Object

A mouse button is pressed.

Syntax

VBPrivate Sub object_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal xPos As OLE_XPOS_PIXELS, ByVal yPos As OLE_YPOS_PIXELS)

object

A SftTabs object.

Button

Describes the button(s) that are pressed. The Button argument is a bit field with bits corresponding to the left button, right button and middle button. These bits correspond to the values shown below. The bits set indicate the button that caused the event.

ButtonValueDescription
constSftControlLeftButton1The left mouse button was pressed.
constSftControlRightButton2The right mouse button was pressed.
constSftControlMiddleButton4The middle mouse button was pressed.

Shift

Describes the state of the SHIFT, CONTROL and ALT keys. A bit is set if the key is down. The Shift argument is a bit field with bits corresponding to the SHIFT, CONTROL and ALT keys. It indicates the state of these keys. Some, all, or none of the bits can be set, indicating which of the keys are pressed.

ShiftValueDescription
constSftControlShiftMask1The SHIFT key is down.
constSftControlCtrlMask2The CONTROL key is down.
constSftControlAltMask4The ALT key is down.

xPos

The x coordinate of the mouse cursor. The units used depend on the container (Visual Basic) and the coordinate system used.

yPos

The y coordinate of the mouse cursor. The units used depend on the container (Visual Basic) and the coordinate system used.

Comments

The MouseDown event occurs when a mouse button is pressed.

The MouseDown event can be used by an application to handle mouse button clicks in combination with keyboard modifiers such as the SHIFT, CONTROL and ALT keys.

The Tabs.HitTest method can be used to determine the tab index of a tab at a given location.

The TabClicked event can be used to determine what portion of the tab was clicked and can be used to suppress tab switching.

The Switching and Switched events should be used to determine which tab is clicked.

Examples

VB6 View entire sample code

        StartX = xPos  ' save the starting location
        StartY = yPos
    End If
End Sub

Private Sub SftTabs1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal xPos As Single, ByVal yPos As Single)
    Dim TabIndex As Integer
    If StartTabIndex >= 0 Then
        ' previously we saw a MouseDown event
        ' we'll make sure the mouse has moved a reasonable distance so this
        ' isn't too sensitive
        If Abs(xPos - StartX) > 40 Or Abs(yPos - StartY) > 40 Then
            ' moved quite a bit, start dragging
            SftTabs1.OLEDrag
        End If
    End If

See Also SftTabs Object | Object Hierarchy


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