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
The user initiates a drag & drop operation.
VB.NET | Private Sub object_DragStarting(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.DragStarting |
VB | Private Sub object_DragStarting(ByVal Button As Integer, ByVal Shift As Integer) |
C#.NET | void object_DragStarting(object sender, EventArgumentType e); |
VC++ | void OnDragStartingobject(short Button, short Shift); |
C | HRESULT OnDragStartingobject(short Button, short Shift); |
object
Button
The button that is pressed during the event (see SftTreeButtonConstants). The button argument is a bit field with bits corresponding to the left button, right button and middle button. These bits correspond to the values shown below. Only one of the bits is set, indicating the button that caused the event.
Button | Value | Description |
---|---|---|
constSftTreeLeftButton | 1 | The left mouse button was pressed. |
constSftTreeRightButton 1) | 2 | The right mouse button was pressed. |
constSftTreeMiddleButton 1) | 4 | The middle mouse button was pressed. |
Shift
The state of the SHIFT, CONTROL and ALT keys during the event (see SftTreeKeyConstants). A bit is set if the key is down. The Shift argument is a bit field with bits corresponding to the SHIFT, CONTROL and ALT keys. The Shift variable indicates the state of these keys. Some, all, or none of the bits can be set, indicating which of the keys are pressed.
Shift | Value | Description |
---|---|---|
constSftTreeShiftMask | 1 | The SHIFT key was pressed. |
constSftTreeCtrlMask | 2 | The CONTROL key was pressed. |
constSftTreeAltMask | 4 | The ALT key was pressed. |
The DragStarting event occurs when the user initiates a drag & drop operation.
1) Depending on the settings of the LeftButtonOnly properties, this event may not be generated for the middle and right mouse buttons.
This event is only available if the DragMethod property is set to dragSftTreeManual and is suitable for drag & drop within one tree control or between multiple controls. The container (i.e. Visual Basic, Visual C++, etc.) must implement the necessary drag & drop support (see DragMethod). The DragStarting event is only used to signal that the user has requested a drag & drop operation. The actual implementation of the drag & drop operation is delegated to the container, which must support drag & drop between controls.
The tree control generates the DragStarting event when the user starts a drag & drop operation. The DragType property determines when a drag & drop operation is started.
A drag & drop operation always starts at the current location described by the Items.Current property. It is the application's responsibility to visually implement the drag & drop operation. When the operation involves the current tree control, this is accomplished by using the Items.HitTest method and the Items.DropHighlight property. If dragging to another tree control, the target tree control's Items.HitTest method and Items.DropHighlight property have to be used. If dragging to another control type (list box, edit control, etc.), other means may have to be used as implemented by the target control.
Note: Some host environments may not implement the required events and properties to drag to another control or control type. Some environments may not even support drag & drop operations at all. The Drag method used in the DragStarting event below is environment specific and not implemented by the tree control. Your environment's approach to initiating a drag & drop operation may involve another methods or may not be available at all. Please see the documentation that came with your development environment for more information about drag & drop.
i = AxSftTree1.Items.Add("Item 1") AxSftTree1.get_Item(i).Level = 1 i = AxSftTree1.Items.Add("Item 2") AxSftTree1.get_Item(i).Level = 2 i = AxSftTree1.Items.Add("Item 3") AxSftTree1.get_Item(i).Level = 1 End Sub Private Sub AxSftTree1_DragStarting(ByVal sender As Object, ByVal e As AxSftTreeLib75._DSftTreeEvents_DragStartingEvent) Handles AxSftTree1.DragStarting AxSftTree1.CancelMode() ' .NET controls drag&drop, so tree control needs to cancel ' This section demonstrates drag (&drop) using the .NET DoDragDrop method ' THIS CODE IS ONLY USED IF DRAGMETHOD IS SET TO ( 1 - Manual ) or SftTreeDragMethodConstants.dragSftTreeManual Dim curr As Integer curr = AxSftTree1.Items.Current
i = axSftTree1.Items.Add("Item 1"); axSftTree1.get_Item(i).Level = 1; i = axSftTree1.Items.Add("Item 2"); axSftTree1.get_Item(i).Level = 2; i = axSftTree1.Items.Add("Item 3"); axSftTree1.get_Item(i).Level = 1; } private void axSftTree1_DragStarting(object sender, AxSftTreeLib75._DSftTreeEvents_DragStartingEvent e) { axSftTree1.CancelMode(); // .NET controls drag&drop, so tree control needs to cancel // This section demonstrates drag (&drop) using the .NET DoDragDrop method // THIS CODE IS ONLY USED IF DRAGMETHOD IS SET TO ( 1 - Manual ) or SftTreeDragMethodConstants.dragSftTreeManual int curr = axSftTree1.Items.Current;
See Also SftTree Object | Object Hierarchy