Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

Item Field, ItemClickEventArgs Class

Defines which item was clicked. May be null/Nothing indicating that no item is associated with this event.

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

Syntax

public readonly ItemClass Item;
Public ReadOnly Item As ItemClass

Comments

Defines which item was clicked. May be null/Nothing indicating that no item is associated with this event.

Examples

C#

        void sftTree1_ShowToolTip(object sender, ToolTipEventArgs e) {
            ItemClass item = e.Cell.OwningItem;
            e.ToolTipText = item.TagString;
        }

        private void sftTree1_ItemClick(object sender, Softelvdm.SftTreeNET.ItemClickEventArgs e) {
            if (e.MouseEv.Button == MouseButtons.Left &&  e.Area == ItemClickAreaEnum.CellSel) {
                ClickCategory(e.Item);
            }
        }

        private void sftTree1_ItemDoubleClick(object sender, ItemClickEventArgs e) {
            if (e.MouseEv.Button == MouseButtons.Left && e.Area == ItemClickAreaEnum.CellSel) {
                ClickCategory(e.Item);
            }
        }

VB.NET

        item.ScrollIntoView()
    Else
        ' selected an item
    End If
End Sub

Private Sub sftTree1_ItemClick(ByVal sender As Object, ByVal e As Softelvdm.SftTreeNET.ItemClickEventArgs) Handles sftTree1.ItemClick
    If e.MouseEv.Button = Windows.Forms.MouseButtons.Left And e.Area = ItemClickAreaEnum.CellSel Then
        ClickCategory(e.Item)
    End If
End Sub

Private Sub sftTree1_ItemDoubleClick(ByVal sender As Object, ByVal e As Softelvdm.SftTreeNET.ItemClickEventArgs) Handles sftTree1.ItemDoubleClick
    If e.MouseEv.Button = Windows.Forms.MouseButtons.Left And e.Area = ItemClickAreaEnum.CellSel Then
        ClickCategory(e.Item)
    End If

See Also ItemClickEventArgs Class | Classes | SftTree/NET 2.0