Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

Usage Field, ItemClickEventArgs Class

Defines in which area of the control the mouse click occurred.

Class: ItemClickEventArgs
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET

Syntax

public readonly UsageLocationEnum Usage;
Public ReadOnly Usage As UsageLocationEnum

Comments

Defines in which area of the control the mouse click occurred.

Examples

C#

            sftTree1.Headers[0, column].SortStatus = fAscending ? SortStatusEnum.Ascending : SortStatusEnum.Descending;
            m_sortedColumn = column;
            return fAscending;
        }

        private void SortData(ItemClickEventArgs e)
        {
            // sort the column last clicked
            if (e.Usage != UsageLocationEnum.header) // we are not interested if the click wasn't in the header
                return;
            if (e.Area != ItemClickAreaEnum.Cell)
                return;

            bool fAscending = SetSorted(e.Cell.ColumnIndex);

            switch (e.Cell.ColumnIndex) {

VB.NET

        sftTree1.Headers(0, column).SortStatus = SortStatusEnum.Descending
    End If
    m_sortedColumn = column
    Return fAscending
End Function

Private Sub SortData(ByVal e As ItemClickEventArgs)
    ' sort the column last clicked
    If e.Usage <> UsageLocationEnum.header Then ' we are not interested if the click wasn't in the header
        Return
    End If
    If e.Area <> ItemClickAreaEnum.Cell Then
        Return
    End If

    Dim fAscending As Boolean = SetSorted(e.Cell.ColumnIndex)

See Also ItemClickEventArgs Class | Classes | SftTree/NET 2.0