|
|
|
SftTree.DragStarting Event |
The user initiates a drag & drop operation.
Syntax
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); |
||
Delphi |
procedure objectDragStarting(Sender: TObject; Button : Smallint; Shift : Smallint); |
object
A SftTree 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 |
1 |
The left mouse button was pressed. |
|
2 |
The right mouse button was pressed. |
|
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 |
1 |
The SHIFT key was pressed. |
|
2 |
The CONTROL key was pressed. |
|
4 |
The ALT key was pressed. |
Comments
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 method or may not be available at all. Please see the documentation that came with your development environment for more information about drag & drop.
See Also SftTree Object | Object Hierarchy