Event DragStart
Occurs when a drag-and-drop operation needs to be started.
event EventHandler<DragStartEventArgs>? DragStart
Returns
- EventHandler<DragStartEventArgs>
- Occurs when a drag-and-drop operation needs to be started.
Examples
The simplest event implementation is the following:
private IDataObject GetDataObject()
{
var result = new DataObject();
result.SetData(DataFormats.Text, "Test data string.");
return result;
}
private void ControlPanel_DragStart(object sender, DragStartEventArgs e)
{
if (e.DistanceIsLess)
return;
e.DragStarted = true;
var result = DoDragDrop(GetDataObject(), DragDropEffects.Copy | DragDropEffects.Move);
}