HeaderPane
Main
Hide
Share Link
Print

SelectionChange Event, SftTree Object

The selection changes.

Syntax

C#void object_SelectionChange(object sender, EventArgumentType e);
VB.NETPrivate Sub object_SelectionChange(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.SelectionChange
C++void OnSelectionChangeobject();
CHRESULT OnSelectionChangeobject();
VBPrivate Sub object_SelectionChange()

object

A SftTree object.

Comments

The SelectionChange event occurs when the selection changes.

The SelectionChange event is not limited to mouse events as the selection can change through keyboard input also. To determine which mouse button was pressed and/or in which area of the tree control the mouse button was pressed, use the MouseDown or ItemClick events.

The Items.SelectionArea property can be used to control the areas that cause a selection change.

Examples

VB.NET View entire sample code

            AxSftTree1.Items.RecalcHorizontalExtent() ' Update horizontal scroll bar
        ElseIf AreaType = SftTreeAreaTypeConstants.constSftTreeColumn And e.colIndex = 0 Then
            SetSortDirection(Not m_SortDirection)
        ElseIf AreaType = SftTreeAreaTypeConstants.constSftTreeCellGraphic Then
            ToggleImage(AxSftTree1.get_Cell(e.itemIndex, e.colIndex).Image)
        End If
    End Sub

    Private Sub AxSftTree1_SelectionChange(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxSftTree1.SelectionChange
        CopyImageFromCurrentItem()
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        ' update all cells that have a progress bar by incrementing the progress value
        Dim Items As Integer = AxSftTree1.Items.Count
        Dim Cols As Integer = AxSftTree1.ColumnsObj.Count

C++ View entire sample code

        break;
    }
}

BEGIN_EVENTSINK_MAP(CPicturesDlg, CDialog)
    //{{AFX_EVENTSINK_MAP(CPicturesDlg)
    ON_EVENT(CPicturesDlg, IDC_SFTTREE1, 4 /* ItemClick */, OnItemClickSftTree1, VTS_I4 VTS_I2 VTS_I2 VTS_I2 VTS_I2)
    ON_EVENT(CPicturesDlg, IDC_SFTTREE1, 5 /* ItemDblClick */, OnItemDblClickSftTree1, VTS_I4 VTS_I2 VTS_I2 VTS_I2 VTS_I2)
    ON_EVENT(CPicturesDlg, IDC_SFTTREE1, 34 /* SelectionChange */, OnSelectionChangeSftTree1, VTS_NONE)
    //}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()

BOOL CPicturesDlg::OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
    INT_PTR dmResult;
    if (SftDarkMode_HandleDialogMessage(m_hWnd, message, wParam, lParam, &dmResult)) {

See Also SftTree Object | Object Hierarchy


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