Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

Handled Field, DragDetectedEventArgs Class

Defines whether the event handler handled the event. This value can be modified by the DragDetected event handler.

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

Syntax

public bool Handled;
Public Handled As Boolean

Comments

Defines whether the event handler handled the event. This value can be modified by the DragDetected event handler.

Default processing normally performed by the tree control should no longer take place (True), otherwise False and the tree control performs its default actions for the current event.

Instead of setting Handled to True, an application can call the SoftelvdmUserControl.CancelMode method while handling an event, which has the effect of setting Handled to True.

Examples

C#

                if (e.Cell.Text == "") s += "(empty cell) ";
                else s += e.Cell.Text + " ";
            } else if (e.RowHeader != null) {
                if (e.RowHeader.Text == "") s += "(empty row header) ";
                else s += e.RowHeader.Text + " ";
            } else if (e.Item != null) {
                s += " an item ";
            }
            e.Handled = true;
            sftTree1.DoDragDrop(s, DragDropEffects.Copy);
        }

        // The textbox just copies data in this example
        private void textBox1_DragEnter(object sender, DragEventArgs e) {
            Debug.Write("*** textBox1 DragEnter ");
            DumpValues(e);

VB.NET

        If e.RowHeader.Text = "" Then
            s = s & "(empty row header) "
        Else
            s = s & e.RowHeader.Text & " "
        End If
    ElseIf Not e.Item Is Nothing Then
        s = s & " an item "
    End If
    e.Handled = True
    sftTree1.DoDragDrop(s, DragDropEffects.Copy)
End Sub

Private Sub textBox1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles textBox1.DragEnter
    Debug.Write("*** textBox1 DragEnter ")
    DumpValues(e)
    If e.Data.GetDataPresent(DataFormats.UnicodeText) Then

See Also DragDetectedEventArgs Class | Classes | SftTree/NET 2.0