SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
A mouse button is double-clicked.
VB.NET | Private Sub object_ItemDblClick(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.ItemDblClick |
VB | Private Sub object_ItemDblClick(ByVal ItemIndex As Long, ByVal ColIndex As Integer, ByVal AreaType As Integer, ByVal Button As Integer, ByVal Shift As Integer) |
C#.NET | void object_ItemDblClick(object sender, EventArgumentType e); |
VC++ | void OnItemDblClickobject(long ItemIndex, short ColIndex, short AreaType, short Button, short Shift); |
C | HRESULT OnItemDblClickobject(long ItemIndex, short ColIndex, short AreaType, short Button, short Shift); |
object
ItemIndex
The zero-based index of the item at the mouse-cursor location when the mouse button was double-clicked. If the area described by AreaType doesn't require item information, this value is undefined.
ColIndex
The column number of the cell at the mouse-cursor location when the mouse button was double-clicked. If the area described by AreaType doesn't require column information, this value is undefined.
AreaType
Defines the area where the mouse button was double-clicked (see SftTreeAreaTypeConstants).
AreaType | Value | Description |
---|---|---|
constSftTreeLabel 2) | 0 | The mouse button was double-clicked on the label graphic. ColIndex is undefined. |
constSftTreePlusMinus 2) | 1 | The mouse button was double-clicked on the plus/minus graphic. ColIndex is undefined. |
constSftTreeTree | 2 | The mouse button was double-clicked in the area where the connecting tree lines are shown. ColIndex is undefined. |
constSftTreeButton 2) | 3 | The mouse button was double-clicked on the expand/collapse button. ColIndex is undefined. |
constSftTreeItem 2) | 4 | The mouse button was double-clicked on the item graphic. ColIndex is undefined. |
constSftTreeText 2) | 5 | The mouse button was double-clicked inside a cell (text or graphic). To distinguish between cell text and cell graphic use constSftTreeCellText or constSftTreeCellGraphic instead. Preceding the ItemDblClick event with this AreaType value, an ItemDblClick event occurs with an AreaType value of constSftTreeCellText or constSftTreeCellGraphic. |
constSftTreeColumnHeader | 6 | The mouse button was double-clicked on the column header. ItemIndex is undefined. |
constSftTreeColumn | 6 | Deprecated - Use constSftTreeColumnHeader instead. The mouse button was pressed on the column header. ItemIndex is undefined. |
constSftTreeRowColumnHeader | 7 | The mouse button was double-clicked on the row/column header. ItemIndex and ColIndex are undefined. |
constSftTreeRowColumn | 7 | Deprecated - Use constSftTreeRowColumnHeader instead. The mouse button was pressed on the row/column header. ItemIndex and ColIndex are undefined. |
constSftTreeRow | 8 | The mouse button was double-clicked on the row header. ColIndex is undefined. |
constSftTreeCellText | 9 | The mouse button was double-clicked inside a cell, but not on the cell graphic. |
constSftTreeCellGraphic | 10 | The mouse button was double-clicked inside a cell on the cell graphic. |
constSftTreeColumnRes | 11 | The mouse button was double-clicked in the column header resizing area. If ColIndex is -1, the splitter bar was double clicked. ItemIndex is undefined. |
constSftTreeExpandAll | 12 | Not used. |
constSftTreeRowColumnFooter | 14 | The mouse button was double-clicked on the row/column footer. ItemIndex and ColIndex are undefined. |
constSftTreeColumnFooter | 15 | The mouse button was double-clicked on the column footer. ItemIndex is undefined. |
constSftTreeColumnHeaderButton | 16 | The header dropdown/filter button was clicked. |
constSftTreeColumnFooterButton | 17 | The footer dropdown/filter button was clicked. |
Button
The button that is pressed during the event (see SftTreeButtonConstants). 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. Only one of the bits is set, indicating the button that caused the event.
Button | Value | Description |
---|---|---|
constSftTreeLeftButton | 1 | The left mouse button was pressed. |
constSftTreeRightButton 1) | 2 | The right mouse button was pressed. |
constSftTreeMiddleButton 1) | 4 | The middle mouse button was pressed. |
Shift
The state of the SHIFT, CONTROL and ALT keys during the event (see SftTreeKeyConstants). 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. The Shift variable indicates the state of these keys. Some, all, or none of the bits can be set, indicating which of the keys are pressed.
Shift | Value | Description |
---|---|---|
constSftTreeShiftMask | 1 | The SHIFT key was pressed. |
constSftTreeCtrlMask | 2 | The CONTROL key was pressed. |
constSftTreeAltMask | 4 | The ALT key was pressed. |
The ItemDblClick event occurs when a mouse button is double-clicked.
1) Depending on the settings of the LeftButtonOnly or LeftItemClickOnly properties, this event may not be generated for the middle and right mouse buttons.
2) If the AutoRespond property is set to True, the areas constSftTreeLabel, constSftTreePlusMinus, constSftTreeButton, constSftTreeItem and constSftTreeText do not generate an ItemDblClick event for the left mouse button. The tree control responds by expanding/collapsing the item automatically. The middle and right mouse buttons still generate the event in those areas.
The ItemDblClick event supplies all the necessary information to the application, so appropriate action can be taken. The application can start cell editing, expand or collapse an item or display application specific information based on the event and the area double-clicked.
The ItemClick event can be used to respond to a single mouse button click.
If the ItemDblClick event is used to display a context sensitive menu (popup menu), the CancelMode method must be used before displaying the context menu.
ToggleImage(AxSftTree1.get_Cell(e.itemIndex, e.colIndex).Image) ElseIf AreaType = SftTreeAreaTypeConstants.constSftTreeItem Then ToggleImage(AxSftTree1.get_Item(e.itemIndex).Image) ElseIf AreaType = SftTreeAreaTypeConstants.constSftTreeLabel Then ToggleImage(AxSftTree1.get_Item(e.itemIndex).LabelImage) End If End Sub Private Sub AxSftTree1_ItemDblClick(ByVal sender As Object, ByVal e As AxSftTreeLib75._DSftTreeEvents_ItemDblClickEvent) Handles AxSftTree1.ItemDblClick Dim AreaType As SftTreeAreaTypeConstants AreaType = e.areaType If AreaType = SftTreeAreaTypeConstants.constSftTreeColumnRes Then AxSftTree1.get_Column(e.colIndex).MakeOptimal() ' Make column width optimal AxSftTree1.Items.RecalcHorizontalExtent() ' Update horizontal scroll bar ElseIf AreaType = SftTreeAreaTypeConstants.constSftTreeColumn And e.colIndex = 0 Then SetSortDirection(Not m_SortDirection)
ToggleImage SftTree1.Cell(ItemIndex, ColIndex).Image ElseIf Area = constSftTreeItem Then ToggleImage SftTree1.Item(ItemIndex).Image ElseIf Area = constSftTreeLabel Then ToggleImage SftTree1.Item(ItemIndex).LabelImage End If End Sub Private Sub SftTree1_ItemDblClick(ByVal ItemIndex As Long, ByVal ColIndex As Integer, ByVal AreaType As Integer, ByVal Button As Integer, ByVal Shift As Integer) Dim Area As SftTreeAreaTypeConstants Area = AreaType If Area = constSftTreeColumnRes Then SftTree1.Column(ColIndex).MakeOptimal ' Make column width optimal SftTree1.Items.RecalcHorizontalExtent ' Update horizontal scroll bar ElseIf Area = constSftTreeColumn And ColIndex = 0 Then SetSortDirection Not SortDirection
else if (areaType == SftTreeAreaTypeConstants.constSftTreeCellGraphic) ToggleImage(axSftTree1.get_Cell(e.itemIndex, e.colIndex).Image); else if (areaType == SftTreeAreaTypeConstants.constSftTreeItem) ToggleImage(axSftTree1.get_Item(e.itemIndex).Image); else if (areaType == SftTreeAreaTypeConstants.constSftTreeLabel) ToggleImage(axSftTree1.get_Item(e.itemIndex).LabelImage); } private void axSftTree1_ItemDblClick(object sender, AxSftTreeLib75._DSftTreeEvents_ItemDblClickEvent e) { SftTreeAreaTypeConstants areaType = (SftTreeAreaTypeConstants) e.areaType; if (areaType == SftTreeAreaTypeConstants.constSftTreeColumnRes) { axSftTree1.get_Column(e.colIndex).MakeOptimal(); // Make column width optimal axSftTree1.Items.RecalcHorizontalExtent(); // Update horizontal scroll bar } else if (areaType == SftTreeAreaTypeConstants.constSftTreeColumn && e.colIndex == 0) SetSortDirection(!m_SortDirection); else if (areaType == SftTreeAreaTypeConstants.constSftTreeCellGraphic)
else if (AreaType == constSftTreeCellGraphic) ToggleImage(m_vTree->Cell[ItemIndex][ColIndex]->Image); else if (AreaType == constSftTreeItem) ToggleImage(m_vTree->Item[ItemIndex]->Image); else if (AreaType == constSftTreeLabel) ToggleImage(m_vTree->Item[ItemIndex]->LabelImage); } void CPicturesDlg::OnItemDblClickSftTree1(long ItemIndex, short ColIndex, short AreaType, short Button, short Shift) { if (AreaType == constSftTreeColumnRes) { m_vTree->Column[ColIndex]->MakeOptimal(); // Make column width optimal m_vTree->Items->RecalcHorizontalExtent(); // Update horizontal scroll bar } else if (AreaType == constSftTreeColumn && ColIndex == 0) SetSortDirection(!m_fSortDirection); else if (AreaType == constSftTreeCellGraphic)
See Also SftTree Object | Object Hierarchy