Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

CopyStyleEnum Enumeration

Used with the ItemClass.Copy method to define how the item is copied.

Class: (none)
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET

Syntax

public enum CopyStyleEnum;
Public Enum CopyStyleEnum

Values

NameDescription
BeforeTargetAsSiblingThe new item is inserted before the target item as the target item's sibling.
AfterTargetAsSiblingThe new item is inserted after the target item as the target item's sibling.
TargetAsParentInsertFirstThe new item is added as the target item's first child item.
TargetAsParentAddThe new item is added as the target item's last child item.

Comments

Used with the ItemClass.Copy method to define how the item is copied.

Examples

C#

                if (e.Effect == DragDropEffects.Move) {
                    try {
                        newItem = originalItem.Move(targetItem, MoveStyleEnum.TargetAsParentInsertFirst);
                    } catch (Exception exc) {
                        MessageBox.Show(exc.Message);
                    }
                } else {
                    try {
                        newItem = originalItem.Copy(targetItem, CopyStyleEnum.TargetAsParentInsertFirst, true);
                    } catch (Exception exc) {
                        MessageBox.Show(exc.Message);
                    }
                }
                if (newItem != null) {
                    sftTree1.Columns.MakeOptimal(0, false);
                    newItem.ScrollIntoView();

VB.NET

        If e.Effect = DragDropEffects.Move Then
            Try
                newItem = originalItem.Move(targetItem, MoveStyleEnum.TargetAsParentInsertFirst)
            Catch exc As Exception
                MessageBox.Show(exc.Message)
            End Try
        Else
            Try
                newItem = originalItem.Copy(targetItem, CopyStyleEnum.TargetAsParentInsertFirst, True)
            Catch exc As Exception
                MessageBox.Show(exc.Message)
            End Try
        End If
        If Not newItem Is Nothing Then
            SftTree1.Columns.MakeOptimal(0, False)
            newItem.ScrollIntoView()

See Also | Classes | SftTree/NET 2.0