Hide

SftBox/OCX 5.0 - Combo Box Control

Display
Print

SftBox.ItemDblClk Event

A mouse button is double-clicked.

Syntax

VB.NETPrivate Sub object_ItemDblClk(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.ItemDblClk
VBPrivate Sub object_ItemDblClk(ByVal Part As SftBoxPortionConstants, ByVal AreaType As SftBoxAreaConstants, ByVal ItemIndex As Long, ByVal ColNum As Integer, ByVal Button As Integer, ByVal Shift As Integer)
C#.NETvoid object_ItemDblClk(object sender, EventArgumentType e);
VC++void OnItemDblClkobject(enum SftBoxPortionConstants Part, enum SftBoxAreaConstants AreaType, long ItemIndex, short ColNum, short Button, short Shift);
CHRESULT OnItemDblClkobject(enum SftBoxPortionConstants Part, enum SftBoxAreaConstants AreaType, long ItemIndex, short ColNum, short Button, short Shift);

object

A SftBox object.

Part

Describes in which part of the combo box the operation has been detected.

PartValueDescription
partSftBoxStatic1Static portion
partSftBoxEdit2Edit control portion
partSftBoxDropDown3Drop down portion

AreaType

Describes the area where the mouse button was double clicked.

AreaTypeValueDescription
areaSftBoxLabel0The label picture was double clicked. ItemIndex has the item's index. ColNum is undefined.
areaSftBoxTree1The area where tree lines are shown was double clicked. ItemIndex has the item's index. ColNum is undefined.
areaSftBoxItem <sup>1)</sup>2The item picture was double clicked. ItemIndex has the item's index. ColNum is undefined.
areaSftBoxCell <sup>1)</sup>3A cell was double clicked. ItemIndex and ColNum describe the cell.
areaSftBoxColumn4A column header was double clicked. ColNum has the column number. ItemIndex is undefined.
areaSftBoxRowCol5The row/column header was double clicked. ItemIndex and ColNum are undefined.
areaSftBoxRow6A row header was double clicked. ItemIndex has the item's index. ColNum is undefined.
areaSftBoxColumnRes7A column header was double clicked in the column resizing area. ColNum has the column number. ItemIndex is undefined.
areaSftBoxButton <sup>1)</sup>9The mouse button was double clicked on the expand/collapse button. ColNum is undefined.
areaSftBoxStatic15The static portion was double clicked. ItemIndex and ColNum describe the cell.

ItemIndex

The zero-based index of the item or undefined depending on AreaType.

ColNum

The zero-based column number where the operation has been detected or undefined depending on AreaType.

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
constSftBoxLeftButton1The left mouse button was pressed.
constSftBoxRightButton2The middle mouse button was pressed.
constSftBoxMiddleButton4The right 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
constSftBoxShiftMask1The SHIFT key is down.
constSftBoxCtrlMask2The CONTROL key is down.
constSftBoxAltMask4The ALT key is down.

Comments

The ItemDblClk event occurs when a mouse button is double-clicked.

<sup>1)</sup> If the AutoRespond property is set to True, the areas areaSftBoxButton, areaSftBoxItem and areaSftBoxCell do not generate an ItemClick event for the left mouse button. The combo box control responds by expanding/collapsing the items automatically. The middle and right mouse buttons still generate the event in those areas.

Double click events in the drop down portion only occur in a simple combo box or if during the preceding ItemClick event the DropDown.Suppress method was used to suppress showing/hiding the drop down portion. Drop down and drop down list combo boxes usually hide the drop down portion in response to the first mouse click, so a double click is not possible, unless the DropDown.Suppress method is used.

Once an ItemClick or ItemDblClk event is processed, the drop down portion may automatically become visible or may be hidden in response. This default action is built into the control. It is possible to suppress the default response by using the DropDown.Suppress method while handling the ItemClick or ItemDblClk event.

The edit control portion does not generate an ItemDblClk event. The MouseDblClk event can be used instead.

An ItemClick event always precedes the ItemDblClk event.

Examples

VB.NET

    Case SftBoxAreaConstants.areaSftBoxButton
        If e.part = SftBoxPortionConstants.partSftBoxDropDown Then
            AxSftBox1.DropDown.Suppress() ' Make sure we don't close the drop down
        End If
        ExpandCollapseItem(e.itemIndex, e.shift)
    End Select
End Sub

Private Sub AxSftBox1_ItemDblClk(ByVal sender As Object, ByVal e As AxSftBoxLib50._ISftBoxEvents_ItemDblClkEvent) Handles AxSftBox1.ItemDblClk
    Select Case e.areaType
    Case SftBoxAreaConstants.areaSftBoxColumnRes
        AxSftBox1.get_Column(e.colNum).MakeOptimal(0) ' Make column width optimal
        AxSftBox1.Items.RecalcHorizontalExtent(0) ' Update horizontal scroll bar
    Case SftBoxAreaConstants.areaSftBoxColumn
        If e.colNum = 0 Then
            SetSortDirection(Not m_SortDirection)

VB6

        If Part = partSftBoxDropDown Then SftBox1.DropDown.Suppress ' Make sure we don't close the drop down
        ToggleImage SftBox1.Item(ItemIndex).LabelImage
    Case areaSftBoxButton
        If Part = partSftBoxDropDown Then SftBox1.DropDown.Suppress ' Make sure we don't close the drop down
        ExpandCollapseItem ItemIndex, Shift
    End Select
End Sub

Private Sub SftBox1_ItemDblClk(ByVal Part As SftBoxLib50.SftBoxPortionConstants, ByVal AreaType As SftBoxLib50.SftBoxAreaConstants, ByVal ItemIndex As Long, ByVal ColNum As Integer, ByVal Button As Integer, ByVal Shift As Integer)
    Select Case AreaType
    Case areaSftBoxColumnRes
        SftBox1.Column(ColNum).MakeOptimal 0 ' Make column width optimal
        SftBox1.Items.RecalcHorizontalExtent 0 ' Update horizontal scroll bar
    Case areaSftBoxColumn
        If ColNum = 0 Then
            SetSortDirection Not SortDirection

C#

    case SftBoxAreaConstants.areaSftBoxButton:
        if (e.part == SftBoxPortionConstants.partSftBoxDropDown)
            axSftBox1.DropDown.Suppress(); // Make sure we don't close the drop down
        ExpandCollapseItem(e.itemIndex, e.shift);
        break;
    }
}

private void axSftBox1_ItemDblClk(object sender, AxSftBoxLib50._ISftBoxEvents_ItemDblClkEvent e)
{
    switch (e.areaType) {
    case SftBoxAreaConstants.areaSftBoxColumnRes:
        axSftBox1.get_Column(e.colNum).MakeOptimal(0); // Make column width optimal
        axSftBox1.Items.RecalcHorizontalExtent(0); // Update horizontal scroll bar
        break;
    case SftBoxAreaConstants.areaSftBoxColumn:

C++

    case areaSftBoxButton:
        if (Part == partSftBoxDropDown)
            m_vBox->DropDown->Suppress(); // Make sure we don't close the drop down
        ExpandCollapseItem(ItemIndex, Shift);
        break;
    }
}

void CPicturesDlg::OnItemDblClkSftBox1(long Part, long AreaType, long ItemIndex, short ColNum, short Button, short Shift)
{
    switch (AreaType) {
    case areaSftBoxColumnRes:
        m_vBox->Column[ColNum]->MakeOptimal(0); // Make column width optimal
        m_vBox->Items->RecalcHorizontalExtent(0); // Update horizontal scroll bar
        break;
    case areaSftBoxColumn:

See Also SftBox Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.