SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Moves an item to a new position in the tree control.
Class: ItemClass
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET
public ItemClass Move( ItemCollectionClass ItemCollection ); public ItemClass Move( ItemClass ItemTarget, MoveStyleEnum Style );
Public Function Move( ByVal ItemCollection As ItemCollectionClass ) As ItemClass Public Function Move( ByVal ItemTarget As ItemClass, ByVal Style As MoveStyleEnum ) As ItemClass
ItemCollection
The item collection.
ItemTarget
Depending on the Style argument, ItemTarget specifies the target item, where the item is to be moved to, or null/Nothing if it is not required.
Style
Defines how the item is moved.
The item object of the item after it has moved.
Moves an item to a new position in the tree control.
Items that are moved lose their selection status and are no longer selected.
An item's child items and all its other properties are automatically moved.
When moving items within the same tree control, the item object returned by the Move method is the same. When moving between tree controls, a new item object represents the moved item in the new, target tree control. The original item object is no longer valid.
The Move method accepting an ItemCollection argument is usually used when moving items to an empty tree control. The tree control's empty item collection is represented by the SftTree.ItemCollection property.
Items that are moved lose their selection status and are no longer selected.
An item's child items and all its other properties are automatically moved.
When moving items within the same tree control, the item object returned by the Move method is the same. When moving between tree controls, a new item object represents the moved item in the new, target tree control. The original item object is no longer valid.
Debug.Write("sftTree1_DragDrop "); DumpValues(e); if (sftTree1.DropTarget != null && e.Data.GetDataPresent(typeof(ItemClass))) { ItemClass originalItem = (ItemClass)e.Data.GetData(typeof(ItemClass)); ItemClass targetItem = (ItemClass)sftTree1.DropTarget; ItemClass newItem = null; 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) {
Debug.Write("sftTree1_DragDrop ") DumpValues(e) If Not SftTree1.DropTarget Is Nothing And e.Data.GetDataPresent(GetType(ItemClass)) Then Dim originalItem As ItemClass = e.Data.GetData(GetType(ItemClass)) Dim targetItem As ItemClass = SftTree1.DropTarget Dim newItem As ItemClass = Nothing 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
See Also ItemClass Class | Classes | SftTree/NET 2.0