SftTree/OCX 7.5 Documentation

Display
Print

SelectionChange Event, SftTree Object

The selection changes.

Syntax

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

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

            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

VB6

        SftTree1.Items.RecalcHorizontalExtent ' Update horizontal scroll bar
    ElseIf Area = constSftTreeColumn And ColIndex = 0 Then
        SetSortDirection Not SortDirection
    ElseIf Area = constSftTreeCellGraphic Then
        ToggleImage SftTree1.Cell(ItemIndex, ColIndex).Image
    End If
End Sub

Private Sub SftTree1_SelectionChange()
    CopyImageFromCurrentItem
End Sub

Private Sub Timer1_Timer()
    ' update all cells that have a progress bar by incrementing the progress value
    Dim Total As Integer, Cols As Integer, ItemIndex As Integer
    Total = SftTree1.Items.Count

C#

                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)
                ToggleImage(axSftTree1.get_Cell(e.itemIndex, e.colIndex).Image);
        }

        private void axSftTree1_SelectionChange(object sender, System.EventArgs e) {
            CopyImageFromCurrentItem();
        }

        private void timer1_Tick(object sender, EventArgs e) {
            // update all cells that have a progress bar by incrementing the progress value
            int items = axSftTree1.Items.Count;
            int cols = axSftTree1.ColumnsObj.Count;

C++

        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)
        ToggleImage(m_vTree->Cell[ItemIndex][ColIndex]->Image);
}

void CPicturesDlg::OnSelectionChangeSftTree1()
{
    CopyImageFromCurrentItem();
}

void CPicturesDlg::ShowSortDirection(BOOL fAscending)
{
    if (fAscending)

See Also SftTree Object | Object Hierarchy


Last Updated 04/28/2018 - (email)
© 2018 Softel vdm, Inc.