windowsforms-devexpress-dot-xtratoolbox-dot-toolboxcontrol-815e71cc.md
Fires when an item’s drag operation starts. Allows you to replace the cursor icon and cancel the drag operation.
Namespace : DevExpress.XtraToolbox
Assembly : DevExpress.XtraBars.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[DXCategory("Events")]
public event ToolboxDragItemStartEventHandler DragItemStart
<DXCategory("Events")>
Public Event DragItemStart As ToolboxDragItemStartEventHandler
The DragItemStart event's data class is ToolboxDragItemStartEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| Cancel | Gets or sets whether a drag-and-drop operation should be canceled. |
| Handled | Gets or sets whether an event was handled; if handled, the default actions are not required. |
| Image | Gets or sets the image displayed near the mouse cursor during drag-and-drop operations. |
The ToolboxControl provides you with events that allow you to manage a drag-and-drop operation during all its stages: the operation on an item is started, the item is being dragged, and the item has been dropped. The events below correspond to each stage of a drag-and-drop operation:
The DragItemStart event — fires when an end-user starts a drag-and-drop operation, and allows you to cancel the action. For this purpose, set the ToolboxDragItemStartEventArgs.Cancel property to true. If this event is canceled, the subsequent ToolboxControl.DragItemMove and ToolboxControl.DragItemDrop events do not fire.
The ToolboxControl.DragItemMove event — fires during the mouse generating event, and allows you to cancel the action. For this purpose, set the ToolboxDragItemMoveEventArgs.Cancel property to true. You can at this stage determine the location of the mouse pointer, and provide feedback to an end-user on whether the item can be dropped at this point by specifying the drag-and-drop effect.
The ToolboxControl.DragItemCancel event — fires when a drag operation is canceled. Users can press the Esc key to cancel a drag operation. You can use a drag event’s Cancel argument to cancel an operation.
The ToolboxControl.DragItemDrop event — fires when the item has been dropped, and allows you to perform custom actions.
At all stages of the drag-and-drop operation, you can get access to the collection of items on which the operation is performed using the Items event argument. The Item event argument returns the first item in the collection.
See Also