HeaderPane
Main
Hide
Share Link
Print

Item Field, DragDetectedEventArgs Class

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

Class: DragDetectedEventArgs
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET

Syntax

public readonly ItemClass Item;
Public ReadOnly Item As ItemClass

Comments

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

Examples

C# View entire sample code

        private void sftTree1_ColumnResized(object sender, Softelvdm.SftTreeNET.ColumnResizedEventArgs e) {
            DumpValues("ColumnResized", e);
        }

        private void sftTree1_DragDetected(object sender, Softelvdm.SftTreeNET.DragDetectedEventArgs e) {
            DumpValues("DragDetected", e);

            if (e.Item.UsageLocation != UsageLocationEnum.items)
                return; // ignore header/footer dragging

            e.Handled = true;
            sftTree1.DoDragDrop("In this example, we are dragging a simple text string", DragDropEffects.Copy);
        }

        private void sftTree1_DragDrop(object sender, DragEventArgs e) {
            DumpValues("DragDrop", e);

VB.NET View entire sample code

Private Sub SftTree1_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SftTree1.DoubleClick
 DumpValues("DoubleClick", e)
End Sub

Private Sub SftTree1_DragDetected(ByVal sender As System.Object, ByVal e As Softelvdm.SftTreeNET.DragDetectedEventArgs) Handles SftTree1.DragDetected
    DumpValues("DragDetected", e)

    If e.Item.UsageLocation <> UsageLocationEnum.items Then
        Return ' ignore header/footer dragging
    End If

    e.Handled = True
    SftTree1.DoDragDrop("In this example, we are dragging a simple text string", DragDropEffects.Copy)
End Sub

Private Sub SftTree1_DragDrop(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles SftTree1.DragDrop

See Also DragDetectedEventArgs Class | Classes | SftTree/NET 3.0