Support
Joined: 18 Jul 2005 Posts: 731
|
Posted: Sat Dec 20, 2008 5:14 am Post subject: HOWTO: Specify the default drop action during drag-drop |
|
|
When an item in your namespace extension is dragged over another location, the default (when Ctrl or Shift keys are not pressed) drop action (Move,Copy or Link) depends on the attributes that the dragged items have. However, you can specify the default drop actions using the PreferredDropEffect property in the GetDataObject method as follows:
Code: |
[C#]
public override void GetDataObject(GetDataObjectEventArgs e)
{
...
...
// Set default drop action to 'Copy'
e.DataObject.PreferredDropEffect = DragDropEffects.Copy;
...
...
}
[VB.Net]
Public Overrides Sub GetDataObject(ByVal e As GetDataObjectEventArgs)
...
...
' Set default drop action to 'Copy'
e.DataObject.PreferredDropEffect = DragDropEffects.Copy
...
...
End Sub |
|
|